Javascript rollover - Image wont flip

They have: 55 posts

Joined: Jun 1999

<HEAD>
<SCRIPT language="JavaScript">

<!--hide

browserName=navigator.appName;
browserVer=parseInt(navigator.appVersion);

if ((browserName=="Netscape" && browserVer>=3) (browserName=="Microsoft Internet Explorer" && browserVer>=4))
version="n3";
else
version="n2";

if (version=="n3")
{
pic1on= new Image(100,25);
pic1on.src="bomb.gif";

pic1off= new Image(100,25);
pic1off.src="bomb2.gif";
}

function lightup(imgName)
{
if (version=="n3")
{
imgOn=eval(imgName + "on.src");
document[imgName].src= imgOn;
}
}

function turnoff(imgName)
{
if (version=="n3")
{
imgOff=eval(imgName + "off.src");
document[imgName].src= imgOff;
}
}

//-->

</SCRIPT>
</HEAD>

They have: 55 posts

Joined: Jun 1999

When I try to do that script, the image won't flip. It stays on for a couple of seconds and then it turns into a broken image.

They have: 2,390 posts

Joined: Nov 1998

Hi John,
Could you post a sample of this script?
JP

----------
The Webmaster Promotion and Resource Center.
http://www.what-next.com

John Pollock's picture

He has: 628 posts

Joined: Mar 1999

The script seems OK. Could you post the url of the page you are using it on, seeing that should help us find why it isn't working.

By the way, I think you have talked with me before through email about other things, are you the F16 guy? Smiling

----------
Page Resource: http://www.pageresource.com
JavaScript City: http://www.javascriptcity.com

They have: 55 posts

Joined: Jun 1999

Yep, I'm the F-16 guy. I'll get ya the page on which the script is on. i was just practicing before I put it on my site. I didn't want to mess up my page cause all of the script junk.

They have: 8 posts

Joined: Jun 1999

This probably is not the case, but
make sure that when you use the xxx.src="bomb.gif";
statement, it is pointing to the directory that your graphic is stored.

Keith LuBrant

----------
SiteLine Development - Quality Web Design & Development
sitelinedev.com

They have: 55 posts

Joined: Jun 1999

Hey, Mr. Lubrant, thanks for your help. That was the prob. And Mr. Pollock, haven't figured out that script over at the microsoft site?

John Pollock's picture

He has: 628 posts

Joined: Mar 1999

Smiling

Wish I could, but it seems that I have no idea how to do that without crashing browsers or making it too instable for use.
Maybe one of these days....

----------
Page Resource: http://www.pageresource.com
JavaScript City: http://www.javascriptcity.com

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.