This is a general FYI.
<mvt:rant>
I work on a lot of sites. Some developers are still using javascript to preload images (circa 2001). It seems they learned one trick and have been using it ever since. Often this comes in the form of a large .js library they are adding to every site they work on even though they only use 1 or 2 the functions. I'd like to demonstrate a simpler method.
</mvt:rant>
Many browsers display the page then display background images last. This is somtimes un-desirable.
Simply preload your imaged directly in the <body> tag area, using style="display: none" as shown below.
<body>
<img src="/images/site_background.jpg" alt="preload this image" style="display: none">
<img src="/images/header_background.jpg" alt="preload this image" style="display: none">
enjoy
<mvt:rant>
I work on a lot of sites. Some developers are still using javascript to preload images (circa 2001). It seems they learned one trick and have been using it ever since. Often this comes in the form of a large .js library they are adding to every site they work on even though they only use 1 or 2 the functions. I'd like to demonstrate a simpler method.
</mvt:rant>
Many browsers display the page then display background images last. This is somtimes un-desirable.
Simply preload your imaged directly in the <body> tag area, using style="display: none" as shown below.
<body>
<img src="/images/site_background.jpg" alt="preload this image" style="display: none">
<img src="/images/header_background.jpg" alt="preload this image" style="display: none">
enjoy
Comment