javascript - Load page once all the images are loaded -


my background image decently large. when page loads, html rendered before background image loaded onto page. background image first thing loaded on page , html. right looks weird because without background image, text gets pushed , when background image loaded, gets pushed regular position (not professional-looking).

is there anyway in javascript accomplish this?

thanks!

i think pre-loading image not solution problem since want images load before html document displayed user.

i dont have exact solution did show loading image user while page loads , hide loading image when body , images loaded. this

    <body onload="document.getelementbyid('mydiv').setattribute('style','display:none');">     <div id=mydiv style="position:absolute;top:0px;left:0px;width:100%;height:100%> <center> <img src="loading.png> </center> </div>       <!-- other html content here -->      </body> 

this rough code, hope helps


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -