Answers for "Smooth Scroll with jQuery"

12

smooth scroll css

html {
  scroll-behavior: smooth;
}

/* No support in IE, or Safari
You can use this JS polyfill for those */
http://iamdustan.com/smoothscroll/
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

how to smooth scroll in javascript

window.scrollTo({ top: 900, behavior: 'smooth' })
Posted by: Guest on September-22-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language