casey palmer
Posts: 0
Joined: Tue Mar 18, 2014 6:32 am

returning from panel scrolls to top of page

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.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

returning from panel scrolls to top of page

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.

casey palmer
Posts: 0
Joined: Tue Mar 18, 2014 6:32 am

returning from panel scrolls to top of page

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

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

returning from panel scrolls to top of page

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.

asid
Posts: 0
Joined: Sun Aug 09, 2015 8:01 pm

returning from panel scrolls to top of page

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

returning from panel scrolls to top of page

Hello Andrew,

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

Return to “Issues”