Home
Available

Welcome to Grubor Design Factory

I'm currently available for new challenges. Please be free to contact me and describe your project in details.

 
GDF Blog Menu
CategoriesArchives

Preload images trick

You probably had situation when you made beautiful menu with large icons different for each menu point. Now you want to have shinny effect when user go rollover your menu point but he will need to wait until this “on hover” image loads. Often he don’t wait and he don’t see the effect. So how to make this work without waiting to load this extra images? Here’s the trick.

List all your hover images anywhere into your html code and give them class name “hidden”. It should look like this:

<br /> <img src="images/image_01.jpg" class="hidden" alt="image_01" /><br /> <img src="images/image_02.jpg" class="hidden" alt="image_02" /><br /> <img src="images/image_02.jpg" class="hidden" alt="image_03" /><br />

Now add this class to your CSS and make all this images invisible. It should look like this:

.hidden {
display: none;
}

This simple trick make this images invisible but they are going to be loaded and placed in users browser cache. So when user goes “mouse over” this images will be already loaded and displayed without any delay.

No Comments

Add your own comment...

Back to Top
Back to Top