Create a gist now

Instantly share code, notes, and snippets.

// jQuery('#myId').scrollToMe();
jQuery.fn.scrollToMe = function(speed,callFunc) {
var that = this;
setTimeout(function() {
var targetOffset = that.offset().top-10;
$('html,body').eq(0).animate({scrollTop: targetOffset}, speed || 500, callFunc);
},500);
return this;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment