I have this animation that works fine in jquery, except that it is pretty laggy. onclick, it scrolls smoothly to the desired item.
$('#aboutMenu').click(function(){
$('html, body').animate({
scrollTop: $( $(this).attr('href') ).offset().top -200
}, 900);
return false;
According to this web page: http://julian.com/research/velocity/
I can just “download Velocity, include it on my page and replace all instances of jQuery $ .animate () with $ .velocity (). You will immediately see increased performance in all browsers and devices - especially on mobile devices.
Well, I do it, but then when I click, nothing else happens.
What am I missing?
source
share