Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Make all links that starts with hash smooth scroll to that div.
- jQuery(document).ready(function(){
- jQuery('a[href^="#"]').on('click', function(event) {
- event.preventDefault();
- var hash = this.hash;
- jQuery('html, body').animate({
- scrollTop: jQuery(hash).offset().top
- }, 800, function(){
- window.location.hash = hash;
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement