Re:jQuery or CSS3 transitions? Speed comparison + brief empi...
by richbradshaw on Sunday January 15, 2012 @08:52AM
(#3467127)
Also, I'd really appreciate some help in explaining the discrepancy here. I've had a go at the bottom of the page, but if anyone has any input I'd be keen to get it as correct as possible.
[ Parent
| on HN ]
Re:jQuery or CSS3 transitions? Speed comparison + brief empi...
by latch on Sunday January 15, 2012 @10:55AM
(#3467378)
Agreed, the analysis doesn't make things too clear. If you look at the code, all the CSS element does is add a class to the containing div. The jquery version has to animate each square.
From his explanation, browsers are smart enough to not only batch (how I'm thinking of it) css animations to all elements, but they also know what part of the screen will change and only have to redraw that.
The jQuery one just spends too much resources changing the properties of all those boxes to have any time to actually redraw the screen.
Re:jQuery or CSS3 transitions? Speed comparison + brief empi...
by richbradshaw on Sunday January 15, 2012 @11:08AM
(#3467412)
The selector is applied to all the boxes, not just the outside one. The point here is that jQuery doesn't work well for doing lots at once really.