Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does display:none still use performance of rendering

Lets say i have markup such as this

<div style='display:none'>
    <!--Flash Object-->
</div>

Would the browser still use resources to load the Flash object, Or would it be delayed till a javascript call is made to switch the dislplay:block;

Now please bear in mind I am not talking about loading the object. I am talking about rendering it. The reason why i clarify this is because if I change the flash object to an img tag it would still download the resource.

The main reason behind this is responsive css design its all well and good changing your website to a css layout to suit the screen but rendering resources takes time and im not sure how browsers handle resources that are downloaded just not rendered.

like image 866
Angel.King.47 Avatar asked Nov 14 '22 10:11

Angel.King.47


1 Answers

Yes , sure, whatever status the "display" attribute is, the flash resource(including regular image, or a music, or something else) will be always rendered.

For my experience, the "display" attribute has no business with "eager/delay loading". If you want to render an object at the last moment, I suggest you use javascript or some other approach.

like image 107
Siwei Avatar answered Nov 29 '22 06:11

Siwei