Javascript rollover - Image wont flip
<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>
john posted this at 01:22 — 18th July 1999.
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.
JP Stones posted this at 01:57 — 18th July 1999.
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 posted this at 18:56 — 18th July 1999.
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?
----------
Page Resource: http://www.pageresource.com
JavaScript City: http://www.javascriptcity.com
Java Script: A Beginner's Guide
Page Resource
john posted this at 00:50 — 19th July 1999.
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.
lubrant posted this at 17:33 — 19th July 1999.
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
john posted this at 00:26 — 20th July 1999.
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 posted this at 03:23 — 20th July 1999.
He has: 628 posts
Joined: Mar 1999
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
Java Script: A Beginner's Guide
Page Resource
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.