Name your widgets! I was able to use the Axshare console to see you have the scroll interactions on an unnamed dynamic panel but I canât for the life of me find that panel in the file.
That said, the problem seems to be youâre moving by and not to. Notice how as you scroll the bar doesnât move at a linear speed? Thatâs because each time the case executes youâre moving less and less or more and more.
You shouldnât need the boundaries either because youâre going to move the bar based on a percentage of how much of the panel has been scrolled. Letâs say the scrollbar total area is 100 tall. When the panel is scrolled to the top you want the bar to be positioned at 0. When the panel is scrolled to the bottom you want the bar positioned at 100 - scrollBar.height. The panel scrolled to the top is panel.scrollY == 0, and scrolled to the bottom (assuming the full repeater is the only content) is panel.scrollY == repeater.height - panel.height. So now we just need to turn the scrolled amount into a percentage of the total possible scroll amount and we can use that to position the bar.
[[panel.scrollY / (repeater.height - panel.height)]] is what percentage of the total way youâve scrolled (represented as a value in the range [0,1])
Now to moving the scrollbar. Since weâre moving to a point we only need to use the OnScroll event, this expression wonât care if youâre scrolling up or down since it only cares about where the scroll actually is at the moment. We established that the maximum y-position of the bar is (let barArea be height of the scrollbar area, not the bar itself) barArea - scrollbar.height, therefore we need to move the bar to:
[[(panel.scrollY / (repeater.height - panel.height)) * (barArea - scrollbar.height)]]
Letâs say barArea is 100 and the scroll bar is 25 high. The maximum y-position is 75. Since our earlier expression gives is a range of [0,1], when youâre scrolled to the top the scroll percentage will be 0 thus the bar will be positioned at 0 * 75, or 0. Right where we want it. When youâre scrolled to the bottom the percentage value will be 1, thus the bar will be at 1 * 75.
After writing all this I quickly tested it in Axure and it worked as expected. Sorry for it being so wordy but I wanted to walk through my thinking and how I arrived at the conclusion.