jquery - Show the <body> background-image when the image itself is ready -


basically let webpage load everything, since image huge, rather not show while browser still downloading it.

instead, want show background (with fading effect) when browser finishes downloading image.

the thing is, background-image must set inside body tag, don't want apply jquery using $('body').hide; or $('body').show; because hides practically entire webpage.

i've been searching feature found cases when people wanted show/hide them in tag (instead of all-wrapping 1 (body in case)).

is possible or i'm reaching mars itself? help!

just set body background-image property after page has been loaded so:

jquery('body').css('background-image', 'url(path/to/some/image.jpg)'); 

see here: http://jsfiddle.net/duffmaster33/z9peg/


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -