Answers for "scroll page on click jquery"

13

scroll to element jquery

$('html, body').animate({
  scrollTop: $("#grepperRocks").offset().top
});
Posted by: Guest on March-18-2020
0

on scroll page jquery

$(window).scroll(function (event) {
  // Do something when the page is scrolled
}
Posted by: Guest on July-28-2021
6

jquery scroll to element

$("#button").click(function() {
    $([document.documentElement, document.body]).animate({
        scrollTop: $("#elementtoScrollToID").offset().top
    }, 2000);
});
Posted by: Guest on July-29-2020
0

how to add scroll to div onclick

<div class="first"><button type="button" onclick="smoothScroll(document.getElementById('second'))">Click Me!</button></div>
<div class="second" id="second">Hi</div>
Posted by: Guest on November-22-2020
0

how to add scroll to div onclick

$("button").click(function() {
    $('html,body').animate({
        scrollTop: $(".second").offset().top},
        'slow');
});
Posted by: Guest on November-22-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language