Answers for "how to make a link scroll down the page"

7

link to section on page html

<!-- #top is the ID of the div where u wanna link to -->
<a href="#top">Go back to the top!</a>

<div id="top"></div>
Posted by: Guest on June-19-2020
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
1

link that scrolls down the page

<a href="#google"></a>

<div id="google"></div>
Posted by: Guest on September-12-2020

Code answers related to "how to make a link scroll down the page"

Browse Popular Code Answers by Language