• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 1. Mouseovers > Preloading Images

Preloading Images

If you did this example with the files on your desktop, you probably didn't notice any problem with the images loading. However, if you posted this file and the images on a server and some random person loaded the page and started playing with your rollovers, they would probably notice a small lag between the time they rolled over the image and when it was actually replaced. This happens because the browser hasn't loaded the rollover images (the ones ending in “_on.gif”) yet. In fact, it doesn't load those images until the user rolled over the image.

The way around this is to load the images into the browser's memory without showing those images to the user. Fortunately, JavaScript provides a relatively straightforward way to do this.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint