Welcome to WebmasterWorld Guest from 54.227.1.130

Forum Moderators: open

Message Too Old, No Replies

Why doesn't my image rollover work in opera?

     

AgentIce

3:03 am on Jul 31, 2003 (gmt 0)

10+ Year Member



I use the following code for an image rollover which works in both IE and Netscape but not in opera:

bName = navigator.appName;
bVer = parseInt(navigator.appVersion);

if ((bName == "Netscape" && bVer >= 3) ¦¦ (bName == "Microsoft Internet Explorer" && bVer >= 4))
bCap = 1;
else
bCap = 0;

function ImageArray(asize) {
for (var lp = 0; lp < asize; lp++) {
this[lp] = new Array();
this[lp][0] = new Image();
this[lp][1] = new Image();
}
this.length = asize + 1;
}

function ImageOn(iname) {
if (bCap) {
document[iname].src = iArray[iname][1].src;
}
}

function ImageOff(iname) {
if (bCap) {
document[iname].src = iArray[iname][0].src;
}
}

iArray = new ImageArray(4);
iArray[0][0].src = "/images/home-bright.jpg";
iArray[0][1].src = "/images/home-dark.jpg";
iArray[1][0].src = "/images/excal-bright.jpg";
iArray[1][1].src = "/images/excal-dark.jpg";
iArray[2][0].src = "/images/commentaries-bright.jpg";
iArray[2][1].src = "/images/commentaries-dark.jpg";
iArray[3][0].src = "/images/cbrworks-bright.jpg";
iArray[3][1].src = "/images/cbrworks-dark.jpg";

Is it because of the browser version checking? I have opera set to identify itself as IE if that matters. If its the browser version checking what should I change it to?

Thanks,
AgentIce

korkus2000

2:38 pm on Aug 3, 2003 (gmt 0)

WebmasterWorld Senior Member korkus2000 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



It maybe the browser checking. Have you tryied using a more basic string for IE in the checking?

AgentIce

11:51 pm on Aug 3, 2003 (gmt 0)

10+ Year Member



I'll try that, I haven't really messed with it at all since I just copied it from some tutorial site. Thanks for the help. :)

AgentIce

 

Featured Threads

Hot Threads This Week

Hot Threads This Month