Created
May 15, 2013 13:26
-
-
Save szpakoli/5583972 to your computer and use it in GitHub Desktop.
Scroll to position with jQuery:
reference: http://web-design-weekly.com/snippets/scroll-to-position-with-jquery/
https://github.com/web-design-weekly/scroll-to-position-demo
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
$.fn.scrollView = function () { | |
return this.each(function () { | |
$('html, body').animate({ | |
scrollTop: $(this).offset().top | |
}, 1000); | |
}); | |
} | |
$('#scroll-link').click(function (event) { | |
event.preventDefault(); | |
$('#header').scrollView(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment