Created
January 9, 2019 14:52
-
-
Save 0632347878/d2bbacec04f42926a3b5daca6f68b7bd to your computer and use it in GitHub Desktop.
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
$('.js-anchor').click(function () { | |
$('html, body').animate({ | |
scrollTop: $($.attr(this, 'href')).offset().top - 50 | |
}, 500); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$('a.toc-link').click(function(e){$('[id="' + $ .attr(this, 'href').substr(1) + '"]').offset().top
e.preventDefault();
$('html, body').animate({
scrollTop:
}, 500);
return false;
});