Guest_imported
New member
- Jan 1, 1970
- 0
I'm writing a Javascript at the moment that simulates a Windows-style start menu (only it will eventually work in every browser, unlike other versions of this program). So far, I can get it to work in IE and Opera, but it won't work in netscape 4.7. For some reason, netscape's Javascript console doesn't report any errors, and it doesn't seem to acknowledge the onMouseOver event. I know netscape's Javascripting is enabled because it works with other websites. I've been trying to debug this for 2 days now and I can't get it work in netscape. What is wrong with my code (I've attached it to the bottom of this message)?
PS: Bear with me if it's an obvious mistake. I'm new to this scripting stuff.
-----
Scott
<html>
<head>
<STYLE>
#layer1 {POSITION:absolute; VISIBILITY:visible; TOP:1px; LEFT:1px; Z-INDEX:2}
#layer2 {POSITION:absolute; VISIBILITY:visible; TOP:100px; LEFT:1px; Z-INDEX:1}
</STYLE>
<script language="Javascript">
var avr = 0;
function alloff() {
document.a1.src="blank.gif";
document.a2.src="blank.gif";
document.a3.src="blank.gif";
document.a4.src="blank.gif";
document.a5.src="blank.gif";
document.b1.src="blank.gif";
document.b2.src="blank.gif";
document.b3.src="blank.gif";
document.b4.src="blank.gif";
document.b5.src="blank.gif";
}
function startstop() {
avr = avr - 1;
if (avr < 0) {
avr = 1;
}
if (avr == 0) {
document.index.src="blank.gif";
document.trad.src="blank.gif";
document.art.src="blank.gif";
document.reel.src="blank.gif";
document.resume.src="blank.gif";
document.mail.src="blank.gif";
}
if (avr == 1) {
document.index.src="btn1.gif";
document.trad.src="btn2.gif";
document.art.src="btn3.gif";
document.reel.src="btn4.gif";
document.resume.src="btn5.gif";
document.mail.src="btn6.gif";
}
alloff();
}
function tradmnu() {
alloff();
document.a1.src="a1.gif";
document.a2.src="a2.gif";
document.a3.src="a3.gif";
document.a4.src="a4.gif";
document.a5.src="a5.gif";
}
function artmnu() {
alloff();
document.b1.src="b1.gif";
document.b2.src="b2.gif";
document.b3.src="b3.gif";
document.b4.src="b4.gif";
document.b5.src="b5.gif";
}
</script>
</head>
<body bgcolor="#000000" text="#ffffff">
<div id="layer1">
<table border=0 valign="top" cellspacing=0 cellpadding=0>
<tr valign="top">
<td>
<img name="start" onMouseOver="startstop()" src="start.gif" border=0>
</td>
<td></td>
</tr>
<tr valign="top">
<td>
<img name="index" src="blank.gif" border=0 onMouseOver="alloff()"><br>
<img name="trad" src="blank.gif" border=0 onMouseOver="tradmnu()"><br>
<img name="art" src="blank.gif" border=0 onMouseOver="artmnu()"><br>
<img name="reel" src="blank.gif" border=0 onMouseOver="alloff()"><br>
<img name="resume" src="blank.gif" border=0 onMouseOver="alloff()"><br>
<img name="mail" src="blank.gif" border=0 onMouseOver="alloff()"><br>
</td>
<td>
<a href=""><img name="a1" src="blank.gif" border=0></a><br>
<a href=""><img name="a2" src="blank.gif" border=0></a><br>
<a href=""><img name="a3" src="blank.gif" border=0></a><br>
<a href=""><img name="a4" src="blank.gif" border=0></a><br>
<a href=""><img name="a5" src="blank.gif" border=0></a><br>
<a href=""><img name="b1" src="blank.gif" border=0></a><br>
<a href=""><img name="b2" src="blank.gif" border=0></a><br>
<a href=""><img name="b3" src="blank.gif" border=0></a><br>
<a href=""><img name="b4" src="blank.gif" border=0></a><br>
<a href=""><img name="b5" src="blank.gif" border=0></a><br>
</td>
</tr>
</table></div>
<div id="layer2">
<br>
<img src="title.jpg">
</div>
</body>
</html>
PS: Bear with me if it's an obvious mistake. I'm new to this scripting stuff.
-----
Scott
<html>
<head>
<STYLE>
#layer1 {POSITION:absolute; VISIBILITY:visible; TOP:1px; LEFT:1px; Z-INDEX:2}
#layer2 {POSITION:absolute; VISIBILITY:visible; TOP:100px; LEFT:1px; Z-INDEX:1}
</STYLE>
<script language="Javascript">
var avr = 0;
function alloff() {
document.a1.src="blank.gif";
document.a2.src="blank.gif";
document.a3.src="blank.gif";
document.a4.src="blank.gif";
document.a5.src="blank.gif";
document.b1.src="blank.gif";
document.b2.src="blank.gif";
document.b3.src="blank.gif";
document.b4.src="blank.gif";
document.b5.src="blank.gif";
}
function startstop() {
avr = avr - 1;
if (avr < 0) {
avr = 1;
}
if (avr == 0) {
document.index.src="blank.gif";
document.trad.src="blank.gif";
document.art.src="blank.gif";
document.reel.src="blank.gif";
document.resume.src="blank.gif";
document.mail.src="blank.gif";
}
if (avr == 1) {
document.index.src="btn1.gif";
document.trad.src="btn2.gif";
document.art.src="btn3.gif";
document.reel.src="btn4.gif";
document.resume.src="btn5.gif";
document.mail.src="btn6.gif";
}
alloff();
}
function tradmnu() {
alloff();
document.a1.src="a1.gif";
document.a2.src="a2.gif";
document.a3.src="a3.gif";
document.a4.src="a4.gif";
document.a5.src="a5.gif";
}
function artmnu() {
alloff();
document.b1.src="b1.gif";
document.b2.src="b2.gif";
document.b3.src="b3.gif";
document.b4.src="b4.gif";
document.b5.src="b5.gif";
}
</script>
</head>
<body bgcolor="#000000" text="#ffffff">
<div id="layer1">
<table border=0 valign="top" cellspacing=0 cellpadding=0>
<tr valign="top">
<td>
<img name="start" onMouseOver="startstop()" src="start.gif" border=0>
</td>
<td></td>
</tr>
<tr valign="top">
<td>
<img name="index" src="blank.gif" border=0 onMouseOver="alloff()"><br>
<img name="trad" src="blank.gif" border=0 onMouseOver="tradmnu()"><br>
<img name="art" src="blank.gif" border=0 onMouseOver="artmnu()"><br>
<img name="reel" src="blank.gif" border=0 onMouseOver="alloff()"><br>
<img name="resume" src="blank.gif" border=0 onMouseOver="alloff()"><br>
<img name="mail" src="blank.gif" border=0 onMouseOver="alloff()"><br>
</td>
<td>
<a href=""><img name="a1" src="blank.gif" border=0></a><br>
<a href=""><img name="a2" src="blank.gif" border=0></a><br>
<a href=""><img name="a3" src="blank.gif" border=0></a><br>
<a href=""><img name="a4" src="blank.gif" border=0></a><br>
<a href=""><img name="a5" src="blank.gif" border=0></a><br>
<a href=""><img name="b1" src="blank.gif" border=0></a><br>
<a href=""><img name="b2" src="blank.gif" border=0></a><br>
<a href=""><img name="b3" src="blank.gif" border=0></a><br>
<a href=""><img name="b4" src="blank.gif" border=0></a><br>
<a href=""><img name="b5" src="blank.gif" border=0></a><br>
</td>
</tr>
</table></div>
<div id="layer2">
<br>
<img src="title.jpg">
</div>
</body>
</html>