Last active
October 14, 2020 17:49
-
-
Save RuslanAsadov/e8c85577769a44e15d677f1302056ec0 to your computer and use it in GitHub Desktop.
slowscroll.js
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
//start slowScroll | |
function slowScroll(id) { | |
if (!$(id).length) { | |
return | |
} | |
var offset = 0 | |
$('html, body').animate( | |
{ | |
scrollTop: $(id).offset().top - offset, | |
}, | |
500 | |
) | |
return false | |
} | |
//close slowScroll | |
//slowScroll($(this).find('a').attr('href')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment