Skip to content

Instantly share code, notes, and snippets.

@OleksandrLz
Created December 10, 2016 19:37
Show Gist options
  • Select an option

  • Save OleksandrLz/bf84946141e4fa3d1d01f626b34dea38 to your computer and use it in GitHub Desktop.

Select an option

Save OleksandrLz/bf84946141e4fa3d1d01f626b34dea38 to your computer and use it in GitHub Desktop.
script for slowly transition between anchors
//.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