Re: Not working in Mozilla -
09-14-2005
, 01:03 PM
Delta wrote:
"I have a HTML/DHTML horizontal menu in IE6 it works fine in Mozilla it
is very bad
what can I use and what I can't ?
code is bellow
thank you for any help"
Hi Delta,
I won't go over all your code with a fine tooth comb, but what really
stood out regarding your functions is that I don't think Mozilla
recognizes document.all.
Instead try using document.getElementById or a conditional for both.
Although it might not make a difference, I would also stay away from
naming the variable id.
It's not the most efficient, but maybe something like this will work:
<script type="text/javascript">
function showmenu(id_s)
{
if (document.getElementById)
{
document.getElementById(id_s).style.visibility = "visible";
}
else
{
document.all(id_s).style.visibility = "visible";
}
}
function hidemenu(id_h)
{
if (document.getElementById)
{
document.getElementById(id_h).style.visibility = "hidden";
}
else
{
document.all(id_h).style.visibility = "hidden";
}
}
</script> |