Forum Discussion
LisaStruebing
12 years agoCommunity Member
Scroll Bar start position
Is there a way to have the scroll bars start with the bar at the bottom of the window/list instead of the top? I'm doing a software simulation and the scroll windows in the software always have the...
RussellKillips-
6 years agoCommunity Member
I forgot to account for the offset.
To get to the bottom, use:
var x = document.getElementsByClassName("scrollarea-area")[0];
x.scrollTop = x.scrollHeight-x.offsetHeight;
And to get to the Middle use:
var x = document.getElementsByClassName("scrollarea-area")[0];
x.scrollTop = (x.scrollHeight-x.offsetHeight)/2;
TeoKar
6 years agoCommunity Member
Hello Russel, thank you for the effort putting in examplaining javascript to us, noobs :)
I was wondering. Will this be possible if the slider was placed horizontally instead of vertically ?
var x = document.getElementsByClassName("scrollarea-area");
x[0].scrollTop = 0;
var width_Slider1 = x[0].scrollWidth - x[0].offsetWidth;
x[0].onscroll = function(){
var player = GetPlayer();
player.SetVar("width_Slider1",x[0].scrollTop);
};
Related Content
- 8 months ago
- 8 months ago