C
C
code-z2021-12-07 00:10:59
css
code-z, 2021-12-07 00:10:59

How to smoothly scroll the page to a specified position after the entire page is fully loaded?

How can I make the page scroll to the very top after reloading, and after the full load there is a smooth scroll to 700 pixels from the top? Like this site:

https://www.on-running.com/en-pl/technology/cloudtec

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aricus, 2021-12-10
@Aricus

In jquery like this:

$("html, body").animate({scrollTop: "0px"}, {queue: false,duration: 0});
$(document).ready(function () {
  $("html, body").animate({scrollTop: "700px"}, 1000, 'swing');
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question