Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

javascript

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

like image 712
TaylorMac Avatar asked Jun 10 '11 06:06

TaylorMac


1 Answers

Give this a try:

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

window.onload = Scrolldown;
like image 98
Michael Robinson Avatar answered Sep 29 '22 00:09

Michael Robinson