Bryan wrote:
> Like I said, I can get the menus to appear in Netscape using
> "document.getElementById" instead of "document.all", but the rest of
> the menu won't drop down to accommodate it. Everything I'm seeing tells
> me to use "document.getElementById", and I do, but nothing tells me how
> to make the menu move for the visible layer.
>
> Are the "document.layers" entries necessary? Maybe they're
> interfering...
Yes they are (besides other things). This is an ancient wartime script
for Netscape 4.x (document.layers) and Internet Explorer (document.all)
Netscape 4.x is gone, but as a reminder document.layers are still
supported (or at least do not return undefined > false) on some
browsers, for example Netscape (what a surprise!) or Safari.
Netscape 8.x adds even more spice in this picture because it operates
in so-called dual mode: depending on the page/script details it uses
either Gesko engine or Internet Explorer engine. As your ... if
(document.layers)... check comes before ...(document.all)... check -
the results may be really interesting but definitely not the expected
ones.
Internet Explorer still supports document.all collection so it works.
But all modern desktop browsers support document.getElementById method
including Internet Explorer.
It is really easier to right a new script from the scratch (will be
much less typing to do). But if you want to base on this code then:
1. Remove all "if (document.layers) {...}" branches completely
2. Replace all "else if (document.all)" with "if
(document.getElementById)"
3. Go through the text and replace all "document.all(" strings with
"document.getElementById("
4. Save and test.
Received on Mon Nov 21 03:30:42 2005