jquery - Page loading bar until the entire page has loaded? -
possible duplicate:
loading bar while script runs
hi, have page has alot of images , wondering if there way delay display of images until entire page has loaded, loading bar maybe, using jquery? great thankyou.
sure easy jquery. use window.load
event determine when images loaded, show content:
html
<html> <body> <div id="loading"></div> <div id="container"> <img src="http://www.playirishlottery.co.uk/wp-content/uploads/image-2.jpg"/> </div> </body> </html>
jquery
$(window).load(function() { //show(); }); function show() { $('#loading').hide(); $('#container').fadein(); }; settimeout(show, 3000);
in above example i've used settimeout
demonstrate. in reality remove , uncomment show() in in .load
function
fiddle: http://jsfiddle.net/xm6v9/
Comments
Post a Comment