Answers for "jquery smooth scroll to element"

13

scroll to element jquery

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

jquery smooth scrool

('a[href*="#"]').on('click', function (e) {
  e.preventDefault()

  $('html, body').animate(
    {
      scrollTop: $($(this).attr('href')).offset().top,
    },
    500,
    'linear'
  )
})
Posted by: Guest on June-01-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

Code answers related to "Javascript"

Browse Popular Code Answers by Language