Scroll to 1000 px from top
$(document).ready(function () {
$('html, body').animate({
scrollTop: $("body").offset().top + 1000
}, 2000);
});
Working Example
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<script>
$(document).ready(function () {
$('html, body').animate({
scrollTop: $("body").offset().top + 1000
}, 2000);
});
</script>
</head>
<body>
<div id="div1" style="height: 5000px; width 100px">
Test
</div>
</body>
</html>
Most Helpful This Week
ES6 method of declaration multiple variables in one line
JavaScript check if first string contains all characters of second string
How to current URL, HOST and URL attributes using JavaScript or jQuery?
jQuery move multi select values from one to another multi select list
How to get selected text from a select box using jQuery?
How to define Global Variable in JavaScript?
Example to take user input and display on screen using JavaScript
jQuery example of scroll to top
jQuery get the coordinates of div clicked
How can I redirect the user from one page to another using jQuery or pure JavaScript?