Created
December 10, 2016 19:37
-
-
Save OleksandrLz/bf84946141e4fa3d1d01f626b34dea38 to your computer and use it in GitHub Desktop.
script for slowly transition between anchors
This file contains hidden or 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
| //.scrollto - class for tag "a" | |
| // 1000 - time for slowly transition | |
| jQuery(document).ready(function() { | |
| jQuery("a.scrollto").click(function () { | |
| elementClick = jQuery(this).attr("href") | |
| destination = jQuery(elementClick).offset().top; | |
| jQuery("html:not(:animated),body:not(:animated)").animate({scrollTop: destination}, 1000); | |
| return false; | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment