Scroll to a section on page load using JQuery | Js Tutorial | Animate

Опубликовано: 04 Октябрь 2024
на канале: Knowledge Thrusters
3,873
32

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