3 ms·
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 h
by latch 15y ago
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.
- 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.