I have this code.
$('a').click(function(){
$('html, body').animate({
scrollTop: $( $.attr(this, 'href') ).offset().top
}, 500);
return false;
});
How can I make this script with a super smooth easing effect?
I have this code.
$('a').click(function(){
$('html, body').animate({
scrollTop: $( $.attr(this, 'href') ).offset().top
}, 500);
return false;
});
How can I make this script with a super smooth easing effect?
Save the
href
attribute before callinganimate
, otherwise the scope ofthis
is incorrect.