TaylorMac TaylorMac - 2 months ago 5
Javascript Question

How to use window.scroll to automatically scroll on pageload?

function Scrolldown() {
window.scroll(0,300);
}


How can I use this function (or a similar one) to automatically scroll down when the page loads? (without clicking a link)

Regards,

taylor

Answer

Give this a try:

function Scrolldown() {
     window.scroll(0,300); 
}

window.onload = Scrolldown;
Comments