[thelist] where's the bug!? (NN4 rollover)
Erik Mattheis
gozz at gozz.com
Fri Mar 8 12:38:01 CST 2002
>For some reason my rollovers are causing a JS error in NN4.
>
>function swapImage(imgName, imgSrc) {
> document[imgName].src=imgSrc;
>}
>
>function out(id) {
> swapImage (id,'/new/images/btn_' + id + '.gif');
>}
Most likely, your images are in a positioned div - if so, you have to
change function to something like:
function swapImage(imgName, imgSrc, theLayer) {
if (document.layers) {
document[theLayer].document[imgName].src=imgSrc;
}
else {
document[imgName].src=imgSrc;
}
}
PS - when IE's prefs are set to check pages "every time" saying
document[imgName].src='/stribg.gif'; is slow - checks the last
modified date for the image on the rollover ... to avoid that, do the
new Image() thing. Yeah baby.
--
__________________________________________
- Erik Mattheis
(612) 377 2272
http://goZz.com/
__________________________________________
More information about the thelist
mailing list