jQuery animations lag and jam -


i'm working on single-page site, few things (h1 opacity, nav height, etc) animated based on scrolling. works, after scrolling around bit, heavy lag , unexpexted behaviour experienced (eg. non-stop toggling of nav height few seconds). tried velocity.js , transit.js, same thing happens. i've made simplified pen demonstrate:

http://codepen.io/galingong/pen/bheyz/

am doing wrong or browser issue?i'm testing in chrome 35.

simple use stop() before animation. problem happenning cause animation queued after each other, , queue longer each animatio. using stop() ensure stop previous animation specific element & starting new point.

e.g.

$('header h1').animate({opacity:0},300); 

change to

$('header h1').stop().animate({opacity:0},300); 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -