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 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)
精彩评论