The background switch
CSS method is much better than using JavaScript to preload images. Create a single image with both the off state stacked on top of the on state. Then use something like this in your
CSS:
- Code: Select all
#imagetabred a {
background: #f00 url("tab.gif") no-repeat 0 0;
}
#imagetabred a:hover {
background-position: 0 100%;
}
That way you don't need to preload anything at all.