Delta Engine Blog

AI, Robotics, multiplatform game development and Strict programming language

How to preload website images

Pretty quick tip because it was a little annoying that the huge background on this site took so long to load sometimes and reading the text was not very easy until all the panel images were loaded too. To make sure that the panel images for all the content are loaded first I just had to add this to the main css file:
#preload img
{
height: 0; width: 0; border-width: 0;
position: absolute;
bottom: 0;
left: 0;
z-index: -30;
}

And then just below the html tag (in my case in the master layout file) add the following code:
BlockLeftTop, PRELOAD etc. for each image ..

  • Found on this good old article from 2006 :)
  • Comments are closed