How to pre-load images That are used on CSS "hover" ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ilya Kraft
    New Member
    • Jan 2011
    • 134

    How to pre-load images That are used on CSS "hover" ?

    Hi,

    Right, I used css "hover" for some div't to change their background image when someone mouse over's them. The problem I faced is that those images are not loading at the begging, person needs to hover the original image and than image that appears on hover starts loading. This looks wrong, because I need that image to appear right when some one hovers it, with no delay.

    So is there a way to pre-load this kind of images right when user accesses website?
  • Death Slaught
    Top Contributor
    • Aug 2007
    • 1137

    #2
    This is possible when using anchors because of the :link pseudo-class. However, since a division doesn't use the href attribute this isn't an option.

    One thing you could do is use sprites. Another, is using a jQuery plugin like this one to load every image in the CSS file.

    Regards
    Death

    Comment

    Working...