dropmenu script (i got one written but doesn't work) ...
Posted: Fri Sep 05, 2003 1:40 pm
ok, i know there are thousands of articles out there that discuss how to do this ... but i follow what they say and it doesn't work. the article i based my script off of is:
http://hotwired.lycos.com/webmonkey/01/ ... =authoring . i'm writing a function to turn on or off a dropmenu represented by a div with the style property "display:none". simple enough, i thought to myself when i started.
well here's my sitch ... and here's some related code:
sample link that would make menu:
<a href="#" onMouseOver="menuOn(company);return true">Company</a>
note the function menuOn() ... here's that function:
function menuOn(obj) {
if (document.all) { // if IE
obj.style.display = 'block';
} else if (document.getElementById) { // if mozilla
document.getElementById(obj).style.display = 'block';
}}
the ie chunk works correctly (using ie 6). the problem is the mozilla chunk. i'm using firebird 0.5 ... and the function as is doesn't work. here's the kicker though, it works as is w/o modification if my link looks like this:
<a href="#" onMouseOver="menuOn('company');return true">Company</a> NOTE: the single quotes around the argument, but of course that won't work in ie.
so you can see the pickle i'm in ... without doing like a document.write to rewrite the entire page, anyone got a suggestions to this problem. thanks for any feedback guys.
http://hotwired.lycos.com/webmonkey/01/ ... =authoring . i'm writing a function to turn on or off a dropmenu represented by a div with the style property "display:none". simple enough, i thought to myself when i started.
well here's my sitch ... and here's some related code:
sample link that would make menu:
<a href="#" onMouseOver="menuOn(company);return true">Company</a>
note the function menuOn() ... here's that function:
function menuOn(obj) {
if (document.all) { // if IE
obj.style.display = 'block';
} else if (document.getElementById) { // if mozilla
document.getElementById(obj).style.display = 'block';
}}
the ie chunk works correctly (using ie 6). the problem is the mozilla chunk. i'm using firebird 0.5 ... and the function as is doesn't work. here's the kicker though, it works as is w/o modification if my link looks like this:
<a href="#" onMouseOver="menuOn('company');return true">Company</a> NOTE: the single quotes around the argument, but of course that won't work in ie.
so you can see the pickle i'm in ... without doing like a document.write to rewrite the entire page, anyone got a suggestions to this problem. thanks for any feedback guys.