Preload images with JavaScript or CSS
I have a small website with two background images for top menu. When I bring mouse first time over a menu element it takes 2-3 seconds that second background image loaded (style link:hover background: url(secondimg.png)). For this short time user see nothing, of course it is annoying. To escape this situation I want to preload all images inklusive background images for menu elements, links, divs etc. Is there a very easy and short javascript or css trick? Thanks for any help!
Similar entries
- Web2 Style CSS Dynamic Menu with Arrows and Background-Images
- Mouseover images with CSS
- Pure CSS Mouseover Menu without Javascript
- DropDown / Rollover Menu with pure CSS / HTML
- Web 2.0 Style two Side Background, Dark to Light Effect
- Change background color onmouseover with Javascript
- Photo Album / Picture Gallery Script with PHP
- Drupal fieldset default expanded not collapsed
- Common HTML / Web colors
- Google's bloody javascript annoying
- Free Banners : 468 x 60
- High tech design/ layout rules
- CSS Tree-Menu (Dynamic)
- Drupal navigation-menu can not be updated!
- A simple website structure
- Upload multiple images with PHP
- Bing vs. Google: a small comparison
- Image watermark with PHP
- howto cp images, mp3 from multiple directory to one directory (find, exec, cp)
- Hide your email address + mailto link with javascript from spammer

To load images before scripts run just put such as js code between your head tags.
Post new comment