I want to automatically scroll the page to 120px as the page loads please help.
I am new to Javascript and jQuery so please use easy javascript or jQuery (And P.S. I'm familier with the "function" thing in javascript).
THANX.
I want to automatically scroll the page to 120px as the page loads please help.
I am new to Javascript and jQuery so please use easy javascript or jQuery (And P.S. I'm familier with the "function" thing in javascript).
THANX.
$("body").animate({ scrollTop: 120 }, "slow");
Make sure that,You write the above line in document.ready()
function
If you are scrolling to a particular element with id element-id
, you can use this:
document.getElementById("element-id").scrollIntoView();