Click to See Complete Forum and Search --> : [RESOLVED] image preload problem


Shawazi
02-06-2008, 01:35 PM
Okay I've done this a million times before - but something funny is happening. If I open Firebug, I see that the images are being called, but when I go over an image I still need to download the image. So it shows me making the first preload request and then the second "actual" request before it caches.


//part of the preload code
var img6 = new Image();
img6.src = prefix+'menuCNOn_306x37.gif';

//code to change images
this._imgObj.onmouseover = function() {
self._imgObj.src = onSrc;
$('navDescImg').src = self.decideDesc(); //always equals something that was in preload
}
this._imgObj.onmouseout = function() {
self._imgObj.src = offSrc;
$('navDescImg').src = '_img/nav/desc_blank.gif';
}