6 ms·
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 ge
by richbradshaw 15y ago
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.
- latch 15y agoAgreed, 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.
- richbradshaw 15y agoThe 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.