Last active
March 14, 2019 21:38
-
-
Save EfremovMS/effb2e918d0081c6da69516acec74405 to your computer and use it in GitHub Desktop.
JS scroll to element
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
// прокрутка к элементу | |
// - [all] | |
let to = $('.object').offset().top; | |
$('html, body').stop().animate({ | |
scrollTop: to | |
}, 0); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment