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
jQuery simple form validations between start date and end date
JavaScript check if first string contains all characters of second string
Highlight and get the details of table row on click using JavaScript
Write a function that splits an array into groups the length of size and returns them as a two-dimensional array
What's the difference between let and var?
How to change text after click event using JavaScript?