Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Where hash is the target element to scroll to
- $('html, body').animate({
- scrollTop: $(hash).offset().top
- }, 800, function(){
- // Add hash (#) to URL when done scrolling (default click behavior)
- window.location.hash = hash;
- });
Add Comment
Please, Sign In to add comment