Answers for "links and when you click on these link it will scroll the page to the respective section."

0

links and when you click on these link it will scroll the page to the respective section.

$("nav").find("a").click(function(e) {
    e.preventDefault();
    var section = $(this).attr("href");
    $("html, body").animate({
        scrollTop: $(section).offset().top
    });
});
Posted by: Guest on January-26-2021

Code answers related to "links and when you click on these link it will scroll the page to the respective section."

Browse Popular Code Answers by Language