Last active
April 4, 2019 09:47
-
-
Save zdimaz/007f124fa2af3672b448108fcc025cd9 to your computer and use it in GitHub Desktop.
Anchor link (Яскорные ссылки)
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
self.anchorLink(); | |
/* | |
* | |
* Anchor Link | |
* | |
*/ | |
anchorLink: function() { | |
$(".js-anchor_link").on("click", function(e){ | |
var anchor = $(this); | |
$('html, body').stop().animate({ | |
scrollTop: $(anchor.attr("data-anchor")).offset().top | |
}, 1000); | |
e.preventDefault(); | |
}); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment