Why doesn't this work in Mozilla?

F

Feudalac!

Working file at:
http://www.elma.hr/test.php


code of menu system at:
http://www.elma.hr/test_code.htm


in mozilla drop down menus are not shown... but in IE everything works
fine...

Anybody knows why?


Please don't comment the code (i am aware that it a mess)(the same
thing written over and over again) I am trying to make it vork
everywhere and then to clean up the code...


Thanks
 
M

Martin Honnen

Feudalac! said:
in mozilla drop down menus are not shown... but in IE everything works
fine...

Anybody knows why?

Yes, Mozilla's JavaScript console tells you

Error: window.event has no properties
Source File: http://www.elma.hr/test.php
Line: 33

even gives you a clickable link there that leads you directly to the
source viewer displaying the line causing that error:

function pop(me,menu) {
document.getElementById(menu).left=window.event.clientX

You need to pass the event object to the function e.g. change

<td width=125 id=prvim onMouseOver="javascript:pop('prvim','prvi')"

to

<td width=125 id=prvim
onmouseover="pop('prvim','prvi', event)"

and add a parameter to the function e.g.
function pop (me, menu, evt) {
then you can use e.g.
evt.clientX
in the function. The properties of the event object for mouse events are
described here:
<http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-MouseEvent>

You will have other issues however, innerText is not supported by Mozilla.

You might want to look at documents like
<http://developer.mozilla.org/en/docs/Migrate_apps_from_Internet_Explorer_to_Mozilla>
if you are serious about developing cross browser stuff.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top