4 ms·
The animation quality is really bad i.e. jerky. The best advice for smooth animation is to leave DOM alone as much as you can. 1) cache all that you can in var
by velcro 10y ago
The animation quality is really bad i.e. jerky. The best advice for smooth animation is to leave DOM alone as much as you can.
1) cache all that you can in variables (i.e. not only cache DOM access but group/batch it). 2) implement requestAnimationFrame. but most of all 3) don't animate top/left properties - instead work with GPU-accelerated ones like transform (not only will they perform faster as no reflows/pains are needed - but the movement will also be sub-pixel i.e. smoother)
- stevethyc 10y agoReload and try it now. I'm using a better system clock now and its way faster. I haven't tried using the transform functions for all movement (just rotation), but I'll do that next.