jquery

Scroll to a div or element using JQuery

$('html, body').animate({
    scrollTop: $("#div_id").offset().top
}, 2000);

You can use this code to scroll to a div or an HTML element with animation using JQuery.

Was this helpful?