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
Post a Comment