tapquo / Lungo.js

A framework for developers who want to design, build and share cross device applications.
http://lungo.tapquo.com
Other
2.41k stars 567 forks source link

Page Scroll Not Repositioning When Loading Into Section #314

Closed saniyusuf closed 9 years ago

saniyusuf commented 10 years ago

Hi It seems there is a problem with Lungo JS Loading Of Events. I have a specified Section where I Show a list of events and I have another one which shows more info of a clicked event. The issue is when an event is clicked and the page with more info loads up, all is fine but if a user scrolls down to read the info and goes back to the previous section to click another event, the new event has its info populated well but it has the section on the same scroll level as the last event so it does not load the page with the scroll level at the top but wherever it was in the last viewed event.

Help

fix commented 10 years ago

yep, you need to catch the tap event and then scroll to top using javascript

Lungo.dom('#eventid-that-is-clicked').tap(function(event) {
   document.getElementById("article-to-scroll-to-top").scrollTop=0;
});
saniyusuf commented 10 years ago

Hi Iv tried This Fix And It Does not work. Anyone else experience this?

fix commented 10 years ago

it is working for me, which browser ?

saniyusuf commented 10 years ago

IOS 7 App

fix commented 10 years ago

I have not tried it, on Safari browser it is ok. Try to see if "scrollTop" is the right way on IOS7 app somehow.

saniyusuf commented 10 years ago

Not sure I understand what you are asking me to try?

fix commented 10 years ago

the way to move to page back to top is to set scrollTop=0 to the scrolled element. Maybe on your app somehow this is not set properly. Or useless.

saniyusuf commented 10 years ago

is there a way I can find the scrolled element or something of the sort. I really need to solve this issue.

On 12 February 2014 18:14, François-Xavier Thoorens < notifications@github.com> wrote:

the way to move to page back to top is to set scrollTop=0 to the scrolled element. Maybe on your app somehow this is not set properly. Or useless.

Reply to this email directly or view it on GitHubhttps://github.com/tapquo/Lungo.js/issues/314#issuecomment-34897872 .

Kind Regards

Sani Yusuf Principal Application Developer @ Huddlebuy Student Ambassador @ Microsoft UK www.saniyusuf.com

kspunia114 commented 10 years ago

Hey saniyusuf, remove scroll class from each article and add following css to your css file:

article{ overflow-y : auto; }

This worked for me on android app.

May help you too.

vtellez commented 9 years ago

@kspunia114 thank you very much for your post!