Share Posted January 19, 2017 Hi guys, Wanted to ask the experts a performance question... Say I have 2 divs that I am fading out at the same time. Is it more efficient for the browser to perform the fade on the 2 objects or would it be better to put them in one div and perform the fade on the div? Thanks! Link to post Share on other sites
Share Posted January 19, 2017 I think rendering two divs will be smoother than three div. if you put 2 div inside one div. browser anyway renders 3div. I am just fan not a developer. Test yourself for understand how to improve code. Link to post Share on other sites
Share Posted January 19, 2017 Frankly I doubt you'd notice any difference. However, technically if you put it in a wrapper div and it is layerized (which can be done by applying a 3D transform, for example), it should force that to the GPU as one layer and then the opacity changes could affect just that layer (thus more performant...but only slightly). This also requires that nothing in the inner-divs is changing/animating (otherwise, it'd have to keep shoving new layer info to the GPU on each tick and make things run slower). Does that help? 1 Link to post Share on other sites
Author Share Posted January 19, 2017 Thanks for the response Jack! It is hard to notice much of a difference. I am dealing with fairly large image assets so every bit counts... Link to post Share on other sites