JavaScript.CoolDev.Com Support Forums
Any questions related to JavaScript menu and JavaScript tree menu by Javascript.CoolDev.Com
| Author |
Message |
GTHOG Guest
|
Posted: Tue Oct 07, 2003 6:48 pm Post subject: My menu works in IE but not in Netscape |
|
|
My simple basic menu works when viewed with IE but fails when viewed with Netscape (I'm using NN 7.1 and COOLjsMenu PRO 2.1.0).
You can see the web site at http://www.hdto.com/hog/test/Events.GTHOG.html.
With Netscape, the sub-menu that appears by mousing-over"Rides & Events" is positioned at the top of the page ... not where it should be (and where it is in IE) which is underneath the main menu.
Note: Netscape does detect JavaScript errors (enter "javascript:" in the URL field to see them). The following error message, from within coolmenupro.js, is repeated three times: "this.a has no properties".
Thanks for any assistance anyone can provide! |
|
| Back to top |
|
 |
GTHOG Guest
|
Posted: Thu Oct 09, 2003 3:02 am Post subject: Fixed! |
|
|
After hours and hours of trial and error, I stumbled across a work-around. It has to do with the DTD tag in my HTML:
| Code: | | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
If this is at the top of my HTML, Netscape 7.1 sub-menus are positioned wrong (at the top of the page instead of just under the main menu item). When I remove it, sub-menus are positioned where they should be. Note, this is not a problem in IE.
Don't ask me why, but removing it (we don't really need it) makes the problem go away. |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Thu Oct 09, 2003 3:24 am Post subject: |
|
|
This is question of standards. If you want to keep DOCTYPE, then find folowing lines in coolmenu.js:
| Code: | this.div(b).style.left=x;
this.div(b).style.top=y; |
and change them to these:
| Code: | this.div(b).style.left=x+'px';
this.div(b).style.top=y+'px'; |
Regarding JavaScript errors. These are not vital, and there is a workaround (havn't tried it yet) if this is really important to you. |
|
| Back to top |
|
 |
GTHOG Guest
|
Posted: Thu Oct 09, 2003 3:27 am Post subject: |
|
|
The JavaScript error was kinda vital because it meant the first time I moused-over the menus nothing would happen. It would work everytime after that (sequence: mouse-over, nothing, mouse-away, mouse-over, works!, mouse-away, mouse-over, works!, etc).
I was able to get the "this.a has no properties" JavaScript error messages in Netscape to go away by changing my <SCRIPT> tags from having:
| Code: | | <script language="JavaScript1.2"> |
to:
| Code: | | <script type="text/javascript"> |
Once again, don't ask me why. It just works.
Last edited by GTHOG on Thu Oct 09, 2003 3:33 am; edited 1 time in total |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Thu Oct 09, 2003 3:32 am Post subject: |
|
|
| Second variant is correct since W3C recommends it. JavaScript 1.2 is really old one - NN4.x has version 1.3, and Mozillas/NN6+ have 1.5 AFAIK. Probably, using 1.2 tag turns on some compatibility. Not sure, just guessing... |
|
| Back to top |
|
 |
GTHOG Guest
|
Posted: Thu Oct 09, 2003 3:39 am Post subject: |
|
|
Interestly, Netscape 7.1 works if I have:
| Code: | | <script language="JavaScript1.3"> |
but did not work (got "this.a has no properties") with:
| Code: | | <script language="JavaScript1.2"> |
I guess Netscape 7.1's JavaScript engine behaves differently depending on the level of JavaScript you specify. But I've learned my lesson, no more cut & paste from old code, I'll use your recommendation.
Alex, BTW, great menu-ing system and great support! |
|
| Back to top |
|
 |
Peter Ciuffetti Guest
|
|
| Back to top |
|
 |
|
|