Hi!
To do this, you’ll need to know how much possible vertical scrolling there can be. Then you divide the current scrollY by that, which results in a value between 0 and 1, meaning 0 when scrollY is 0, and 1 when scrollY is at its maximum scroll. Then you take that 0-to1 value and multiply that by the maximum width of the slider.
Here I have a pinned dynamic panel called “sliderPanel” inside of which is another DP that will serve as the slider, called “slider”. We have to know the total height of the page, so I placed a hotspot at the bottom of the page called “pageBottom”.
You’ll need to use some local variables here, but the formula for the width (based on the above) of the slider is:
Set Size of slider to (width) = [[Window.scrollY / (LV_pageBottom.bottom - Window.height) * LV_scrollerPanel.width]], (height) = 12
… where LV_pageBottom is a local variable pointing to the hotpsot and LV_scrollerPanel is the pinned-to-browser panel that contains the slider. The latter’s width is the maximum width of the slider, and (LV_pageBottom.bottom - Window.height) gives us the possible scrollable range.
Note that OnWindowResize I fire the event OnWindowScroll, since that affects the scrollable area.
Preview
File: scrollIndicator.rp (54.7 KB)