Skip to content

Instantly share code, notes, and snippets.

@dejoe
dejoe / scrollToViewPort.js
Created March 3, 2011 23:21
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);
});
}