Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image precaching

Tags:

css

image

onload

at the website I'm working on euroworker.no, I have a ton of CSS rollovers, that only load when rolled over, is there a way to force load these onLoad so that they don't flash when rolled over the first time? It makes the site look broken. I could use a <body onLoad...> but am not sure how to implement it.

Thanks.

like image 795
Kyle Avatar asked Dec 08 '25 15:12

Kyle


1 Answers

Sure, just use image sprites. In short, this means you put both states of an image (default and hover) in one image file. Upon hover, you then shift the background-position of the element in question.

like image 79
Mathias Bynens Avatar answered Dec 11 '25 01:12

Mathias Bynens



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!