Jquery is a way to jump to a specified location on a page

  • 2020-03-30 02:58:45
  • OfStack

Offset () (including top left)
 
height() 
scrollTop 
$("body").scrollTop(**); 

The idea is to change the scrollTop of the page.

Jquery animate ()
 
$("html,body").animate({ scrollTop: **}, 500); 
$("html,body").animate({ scrollTop: $().offset().top-$().height() }, 500); 

Related articles: