Help - Search - Members - Calendar
Full Version: Simple Method Of Image Pre-loading
Zymic Webmaster Forums > Web Design & Development > Client Side Scripting > HTML and CSS
Perry
I was introduced to a simple way to preload images without Javascript. This method uses basic CSS and HTML.

CSS Code
CODE
div#preload {
display:none;
}


HTML Code
CODE
<div id="preload">
<img src="./images/image1.png">
<img src="./images/image2.png">
<img src="./images/image3.png">
</div>


That's it. Place the HTML code at the beginning of your document, directly following your <body> tags. How this works is your browser loads the images before your actuall usage of them. The CSS code sets your div containing the preloaded images to invisible, so no one can notice them.

Example: Without Pre-Load | With Preload

Hope this is useful to someone smile.gif
Jacob
I find the AJAX (pre)loaders a whole lot more useful then CSS/HTML (only) ones. Thanks anyways.
rosyolivia
Thank you for your code on image pre-loading.
compariprice
what is preloading? your links don't work.
t05106
That codes are very useful, thanks for your codes.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.