Instantly share code, notes, and snippets.

@iredun /js.js
Created Apr 20, 2017

Embed
What would you like to do?
scrollTo jQuery extend
jQuery.fn.extend(
{
scrollTo : function(speed, easing)
{
return this.each(function()
{
var targetOffset = $(this).offset().top;
$('html,body').animate({scrollTop: targetOffset}, speed, easing);
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment