Created
June 16, 2012 11:48
-
-
Save zetareticoli/2941119 to your computer and use it in GitHub Desktop.
Animated scroll to anchor/id function with jQuery
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 goToByScroll(id){ | |
$('html,body').animate({scrollTop: $("#"+id).offset().top},'slow'); | |
} | |
<a href="#linkID" onclick="goToByScroll('linkID')">Link</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks,
from top to bottom?