开发者

Do hidden animated GIFs still use the CPU?

开发者 https://www.devze.com 2023-02-16 03:21 出处:网络
I have an AJAX heavy website. There\'s hundreds of buttons that momentarily put up an animated loading GIF when the server is processing a request.

I have an AJAX heavy website. There's hundreds of buttons that momentarily put up an animated loading GIF when the server is processing a request.

Do hidden animated GIFs still use the CPU?

I noticed that my site is sluggish after using it for several minutes. The animated GIFs play at lower framerate. They sometimes even stop animating. Hover effects on buttons have a noticeable lag. Is it possible that these hundred animated GIFs are still locking up the CPU even while they're hidden (style="display: none")? At most, only a few 开发者_运维技巧GIFs are visible at any point in time.


Things that are hidden using style-sheets still exist in, and are resolved by the browser (and can therefore be manipulated by script), they are just not displayed to the user.

This is in contrast to when controls are marked as .visible=false in which case they are not marked up in the browser (and therefore cannot by manipulated by script)

0

精彩评论

暂无评论...
验证码 换一张
取 消