Help! Need page to remember Scroll position


#1

Hi there, i’m prototyping a simple click through and want the page to remember the scroll position, there is this Maintain scroll position after click but i have no idea how to implement it, i’ve only been using axure for a day… Any help would be really appreciated…


#2

Add a Hotspot widget. Give it a name. How about “ScrollTarget”. Add a global variable. Let’s call it “ScrollPosition”.

OnWindowScroll
Set value of ScrollPosition to: [[Window.scrollY]]

OnPageLoad
Move widget ScrollTarget to X:0, Y:[[ScrollPosition]]
Scroll to widget ScrollTarget


#3

That works great, thank you so much!


#4

Is there any way to do the same, but inside of scrolling dynamic panel? I do not have window to scroll, but panel.


#5

Hi Jerry000,

You can do this with the dynamic panel’s OnScroll event with [[widget.scrollY]]. So following nkrisc’s example:

  1. Add a hot spot widget inside the targeted state of your dynamic panel.
  2. Add a global variable, e.g. scrollposition.
  3. OnScroll of the dynamic panel, set value of scrollposition to [[This.scrollY]] where This is the dynamic panel.
  4. Add an additional Move To interaction to the OnScroll where you move the hot spot to (0, [[scrollposition]]).

I’ve added an example file to demonstrate this. Hope it helps!

SaveScrollinDP.rp (56.6 KB)


closed #6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.