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
How to define Global Variable in JavaScript?
How to declare multiple variables in one statement in Javascript?
What's the difference between let and var?
jQuery check if an element is visible or hidden
JavaScript HTML5 Validation for name and email field
Write a function that splits an array into groups the length of size and returns them as a two-dimensional array