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-
5 years agoCommunity Member
Hello Alisha,
Take a look at this story file.
To scroll to the bottom, I'm using this code:
var x = document.getElementsByClassName("scrollarea-area")[0];
x.scrollTop = x.scrollHeight-x.offsetHeight;
If you have a second scroll area, you need to change the code to target the second one.
Notice the 0 is changed to 1.
var x = document.getElementsByClassName("scrollarea-area")[1];
x.scrollTop = x.scrollHeight-x.offsetHeight;
If you have a third scroll area, you need to change the code to target the third one.
This time it is set to 2.
var x = document.getElementsByClassName("scrollarea-area")[2];
x.scrollTop = x.scrollHeight-x.offsetHeight;
MarkWoolway
2 years agoCommunity Member
Thank you for this work around. It works perfectly. Thanks again for sharing.
Related Content
- 6 months ago
- 6 months ago