Page 1 of 1

returning from panel scrolls to top of page

Posted: Mon Apr 28, 2014 5:00 am
by casey palmer

Hello,

first of all, thank you for your support here. I appreciate your help and patience with beginners like me.

I have a button that is way down on a page that opens a panel, when I get the info I need from the panel and close it to return back to the page it always returns me to the top of the page instead of returning me to the point I was at on the page when I clicked the button to open the panel.. I tried to add a focus to an input when the panel closes but this only works on the browser test and not when I test native using the Appery.io app from app store on the phone, iPhone. Is there a way to help with this where when I close a panel not to always return back to the top of the page. thanks, any suggestions are appreciated.


returning from panel scrolls to top of page

Posted: Mon Apr 28, 2014 6:06 am
by Kateryna Grynko

Hi Casey,

You'll need scrollTop function: https://api.jquery.com/scrollTop/

Call this function on panel close:pre$(window).scrollTop(Appery("buttonName").offset().top - 50);/preWhere 'buttonName' is a button component name.


returning from panel scrolls to top of page

Posted: Mon Apr 28, 2014 7:06 pm
by casey palmer

I tested quickly and it looks like this works in both browser test and using the appery app on iPhone.. Fantastic Support.. Thank you..


returning from panel scrolls to top of page

Posted: Fri Oct 23, 2015 8:33 pm
by Yurii Orishchuk

Here is a solution to restore scrollTop after panel close.

1 on list item "click" add JS even handler with following js code:
Details: http://prntscr.com/8u98e2/direct

pre

self.storedTopScroll = jQuery(window).scrollTop();

/pre

2 Put this event handler to be before event handler(open panel).
Details: http://prntscr.com/8u9876/direct

3 Open panel.

4 Put there "Close panel" button.
Details:

5 Add to this "Close panel" button "click" event handler with action "Close panel" and choose here your current panel.

6 Add one more "Close panel" button "click" event handler with action "Run javascript" and use following js code:

pre

var onDelay = function(){
jQuery(window).scrollTop(self.storedTopScroll);
};

window.setTimeout(onDelay, 100);

/pre

Details: http://prntscr.com/8u99nl/direct

Regards.


returning from panel scrolls to top of page

Posted: Thu Jan 07, 2016 2:01 am
by asid

Hi, I have a similar issue, when I open the panel from a listitem I can see the list in the background scroll to the top. The above method did not stop this?
Thank you


returning from panel scrolls to top of page

Posted: Fri Jan 15, 2016 7:31 pm
by Serhii Kulibaba

Hello Andrew,

Did you find the sollution here https://getsatisfaction.com/apperyio/... ?