framework7

Open full view…

Back - Page Scroll Position

Mustafa Arslan
Mon, 23 Mar 2015 09:26:25 GMT

Hi Everyone, I'm working on a mobile project for a news site. When I scroll down on index page and click something, It opens detail page. After that if I try to go back to index page, I lost scroll position and page goes back to top. I couldn't keep the scroll position. Could you help me to figure problem out? www.sozcu.com.tr/test/mobilev2/index Thanks, Mustafa.

Vladimir Kharlampidi
Mon, 23 Mar 2015 11:36:54 GMT

You use external links, so you don't use F7's routing, so it is impossible to save scroll position. Your app behaves like usual website

Mustafa Arslan
Tue, 24 Mar 2015 10:26:02 GMT

Hey Vlad, Thanks for feedback. I have one more question to you, ( weird one :) ) When I scroll on main page, if I try to stop and touch screen a little bit hard, acts so sensitive and causes unintentional clicks. Is there any way to stop that, is it related to fastclick?

Vladimir Kharlampidi
Tue, 24 Mar 2015 10:57:24 GMT

Yes, it is related to fastclick, you can try to disable it and watch on behavior. But it also depends on device and OS

Mustafa Arslan
Tue, 24 Mar 2015 12:19:20 GMT

Vlad one more thing, how can I get scroll end event? I'll disable clicks on scroll enable it after 25ms later on scroll end. Could you help me to get ended event? Thanks

Vladimir Kharlampidi
Tue, 24 Mar 2015 20:52:57 GMT

That is not simple question, you can watch for scrolling like: --- $('.page-content').on('scroll', function(){ //do something here on page scroll }) --- But anyway, it is not that simple because there are a lot of things to care of with clicks prevention. Maybe it is better for you to look at the source code of fast clicks and try to modify it :)

Bourbon
Thu, 02 Apr 2015 08:34:30 GMT

Is it necessary to cache sites for saving scroll position?

edvenkat
Fri, 19 May 2017 07:46:37 GMT

But scroll position is not updating while scrolling.... At the scroll end only called please advice......