Scroll to a section on page load using JQuery | Js Tutorial | Animate
HTML-код
- Опубликовано: 1 окт 2024
- In this tutorial, you will learn how to scroll to particular section when you load a page in jquery.
used jquery animation
used scrolltop for scrolling to top
used offset for getting the current position of element
Scroll to a section on page load using JQuery | Js Tutorial
jQuery("html").animate({
scrollTop:jQuery("#newsection").offset().top - 100;
});
#jquery #knowledgethrusters
Short and simple. Thank you very much.
100 M subscriber honge 1001%