The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How to preload images for mouse rollover in the navbar?

3 posters

Go down

In progress How to preload images for mouse rollover in the navbar?

Post by Soulmonster Wed 8 Jun 2011 - 8:30

Hi,

I have a navbar consisting of images. I have added a nice rollover effect so the pictures change whenever someone hovers the mouse over the pictures. BUT, it lags. Is it possible to preload the hover images so that this lag disappears?
avatar
Soulmonster
Forumember

Posts : 228
Reputation : 2
Language : Norwegian

Back to top Go down

In progress Re: How to preload images for mouse rollover in the navbar?

Post by Sanket Wed 8 Jun 2011 - 8:34

A technique used for just what you do. You can try to implement it. I am not sure how you added a rollover for a navbar.
http://www.webartzforum.com/t420-rollover-button-using-css
Sanket
Sanket
ForumGuru

Male Posts : 48766
Reputation : 2830
Language : English
Location : Mumbai

Back to top Go down

In progress Re: How to preload images for mouse rollover in the navbar?

Post by Mr_Waffle Wed 8 Jun 2011 - 10:06

Maybe try loading the pictures in a hidden div like so:
Code:
<div style="height:1px;width:1px;visibility:hidden;">
<img src=""> //multiple times
</div>
Or try loading the pictures somewhere on the page but with 0 height and width, like so:
Code:
<img src="" style="height:0;width:0;">
I have no idea if either of these codes actually load the picture in the background, but you can try it. If it doesn't work, you can also try to put image heigth and width to 1 in the second example.
Mr_Waffle
Mr_Waffle
New Member

Posts : 24
Reputation : 0
Language : Dutch | HTML | CSS | JavaScript | jQuery | Java | MIPS ASM | Learning C#

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum