Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascripting and netscape compatibility issues

Status
Not open for further replies.

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=&quot;Javascript&quot;>

var avr = 0;

function alloff() {

document.a1.src=&quot;blank.gif&quot;;
document.a2.src=&quot;blank.gif&quot;;
document.a3.src=&quot;blank.gif&quot;;
document.a4.src=&quot;blank.gif&quot;;
document.a5.src=&quot;blank.gif&quot;;
document.b1.src=&quot;blank.gif&quot;;
document.b2.src=&quot;blank.gif&quot;;
document.b3.src=&quot;blank.gif&quot;;
document.b4.src=&quot;blank.gif&quot;;
document.b5.src=&quot;blank.gif&quot;;
}

function startstop() {

avr = avr - 1;
if (avr < 0) {
avr = 1;
}
if (avr == 0) {
document.index.src=&quot;blank.gif&quot;;
document.trad.src=&quot;blank.gif&quot;;
document.art.src=&quot;blank.gif&quot;;
document.reel.src=&quot;blank.gif&quot;;
document.resume.src=&quot;blank.gif&quot;;
document.mail.src=&quot;blank.gif&quot;;
}

if (avr == 1) {
document.index.src=&quot;btn1.gif&quot;;
document.trad.src=&quot;btn2.gif&quot;;
document.art.src=&quot;btn3.gif&quot;;
document.reel.src=&quot;btn4.gif&quot;;
document.resume.src=&quot;btn5.gif&quot;;
document.mail.src=&quot;btn6.gif&quot;;
}
alloff();
}

function tradmnu() {
alloff();
document.a1.src=&quot;a1.gif&quot;;
document.a2.src=&quot;a2.gif&quot;;
document.a3.src=&quot;a3.gif&quot;;
document.a4.src=&quot;a4.gif&quot;;
document.a5.src=&quot;a5.gif&quot;;
}

function artmnu() {
alloff();
document.b1.src=&quot;b1.gif&quot;;
document.b2.src=&quot;b2.gif&quot;;
document.b3.src=&quot;b3.gif&quot;;
document.b4.src=&quot;b4.gif&quot;;
document.b5.src=&quot;b5.gif&quot;;
}
</script>
</head>
<body bgcolor=&quot;#000000&quot; text=&quot;#ffffff&quot;>
<div id=&quot;layer1&quot;>
<table border=0 valign=&quot;top&quot; cellspacing=0 cellpadding=0>
<tr valign=&quot;top&quot;>
<td>
<img name=&quot;start&quot; onMouseOver=&quot;startstop()&quot; src=&quot;start.gif&quot; border=0>
</td>
<td></td>
</tr>
<tr valign=&quot;top&quot;>
<td>
<img name=&quot;index&quot; src=&quot;blank.gif&quot; border=0 onMouseOver=&quot;alloff()&quot;><br>
<img name=&quot;trad&quot; src=&quot;blank.gif&quot; border=0 onMouseOver=&quot;tradmnu()&quot;><br>
<img name=&quot;art&quot; src=&quot;blank.gif&quot; border=0 onMouseOver=&quot;artmnu()&quot;><br>
<img name=&quot;reel&quot; src=&quot;blank.gif&quot; border=0 onMouseOver=&quot;alloff()&quot;><br>
<img name=&quot;resume&quot; src=&quot;blank.gif&quot; border=0 onMouseOver=&quot;alloff()&quot;><br>
<img name=&quot;mail&quot; src=&quot;blank.gif&quot; border=0 onMouseOver=&quot;alloff()&quot;><br>
</td>
<td>
<a href=&quot;&quot;><img name=&quot;a1&quot; src=&quot;blank.gif&quot; border=0></a><br>
<a href=&quot;&quot;><img name=&quot;a2&quot; src=&quot;blank.gif&quot; border=0></a><br>
<a href=&quot;&quot;><img name=&quot;a3&quot; src=&quot;blank.gif&quot; border=0></a><br>
<a href=&quot;&quot;><img name=&quot;a4&quot; src=&quot;blank.gif&quot; border=0></a><br>
<a href=&quot;&quot;><img name=&quot;a5&quot; src=&quot;blank.gif&quot; border=0></a><br>
<a href=&quot;&quot;><img name=&quot;b1&quot; src=&quot;blank.gif&quot; border=0></a><br>
<a href=&quot;&quot;><img name=&quot;b2&quot; src=&quot;blank.gif&quot; border=0></a><br>
<a href=&quot;&quot;><img name=&quot;b3&quot; src=&quot;blank.gif&quot; border=0></a><br>
<a href=&quot;&quot;><img name=&quot;b4&quot; src=&quot;blank.gif&quot; border=0></a><br>
<a href=&quot;&quot;><img name=&quot;b5&quot; src=&quot;blank.gif&quot; border=0></a><br>
</td>
</tr>
</table></div>
<div id=&quot;layer2&quot;>
<br>
<img src=&quot;title.jpg&quot;>
</div>
</body>
</html>
 
The reason is probably that Netscape 4.x does not accept events from anything but links and form elements.

So where you have images with mouseOver events, you will need to make them into links.

Also - don't worry so much about Netscape 4, anyone using it is a loser - anyone using Netscape at all is most likely a moron.

BB
 
no'p as far as i know, images in netscrap4x *support* (bad word, i know) the following events:
mouseover
mouseout
mousedown
mouseup
focus
blur

.. (don't remember, becouse didn't used rest of'em)

looks like it is about style definitions:
<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>


for netscrap it should be visibility:show;

so, combine both visible & show, it would work in nn & ie..
Victor
 
Thanks guys. It turns out it was a problem with passing events in images.
 
When you've got this working completely, we'd love to see it! Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top