Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Jquery Scroll To View Port
jQuery.fn.scrollToViewPort = function(animTimeInterval) {
animTimeInterval = (typeof animTimeInterval == "undefined")?"slow":animTimeInterval;
return this.each(function(){
$('html,body').animate({scrollTop: $(this).offset().top},animTimeInterval);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.