-
-
Save chayn1k/f75ecdaa24f59e8face8 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
function scrollToElement( target ) { | |
var topoffset = 30; | |
var speed = 800; | |
var destination = jQuery( target ).offset().top - topoffset; | |
jQuery( 'html:not(:animated),body:not(:animated)' ).animate( { scrollTop: destination}, speed, function() { | |
window.location.hash = target; | |
}); | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment