cross browser - preloading images from css, what's the governing rule? -


all visitors visit page load style.css contains colorbox line:

#cboxloadinggraphic{background:url(/images/animation.gif) no-repeat center center} 

this animation image should show when clicking button on page, loading animation displayed while loading colorbox modal window.

yet, i've noticed there various visitors automatically preload animation.gif, though didn't click button (and didn't open modal window).

but since happening 1/3 of visitors, different browesers, can't understand what's governing rule, makes 1 user preload it, , user load when , if clicks on said button?

the rules along these lines:

it not matter put in css in terms or links images, since it(browser) load resource if element on page , visible! visible means except display:none , different states of element, :hover state.

this not apply embedded base64 images inside css files. load stylesheet.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

jquery - Keeping Kendo Datepicker in min/max range -