L
leemundie
Hi, Thanks for any help in advance
I'm using the following JS to drop/show content that is hidden:
function expandDiv(tahw) {
what = tahw + "_menu"
if (document.getElementById(what).style.display == "none") {
document.getElementById(what).style.display = "";
} else {
document.getElementById(what).style.display = "none";
}
}
where:
<div class="LftNavDrop" id="LeftNav"><a href="javascript:
expandDiv('leftnav1')" onClick="javascript:
expandDiv('leftnav1')">Etiam Accumsan<br />& Curabitur
Viverra</a></div>
<div class="LftNavDropped" style="display: none" id="leftnav1_menu">
Content...
</div>
(Which works in IE only)
But would really like for the JS to test conditions for ALL browsers
based on/or something similar to:
if (document.layers)
{ document.layers['DIV'];
else if (document.all)
{ document.all.tags("DIV"); alert('Works in IE');}
else if (document.all || document.layers)
{ document.all.tags("DIV");}
else if (document.getElementByTag && document.all)
{ document.getElementById("DIV");}
else if (document.getElementByTag && !document.all)
{ document.getElementById("DIV");}
else if (document.getElementByTag)
{ document.getElementById("DIV");}
else
{ alert('Sorry, One of our main navigation systems does not support
your browser.'); }
}
Please, can anyone help me fix this above script so that it will work?
Regards
Lee
I'm using the following JS to drop/show content that is hidden:
function expandDiv(tahw) {
what = tahw + "_menu"
if (document.getElementById(what).style.display == "none") {
document.getElementById(what).style.display = "";
} else {
document.getElementById(what).style.display = "none";
}
}
where:
<div class="LftNavDrop" id="LeftNav"><a href="javascript:
expandDiv('leftnav1')" onClick="javascript:
expandDiv('leftnav1')">Etiam Accumsan<br />& Curabitur
Viverra</a></div>
<div class="LftNavDropped" style="display: none" id="leftnav1_menu">
Content...
</div>
(Which works in IE only)
But would really like for the JS to test conditions for ALL browsers
based on/or something similar to:
if (document.layers)
{ document.layers['DIV'];
else if (document.all)
{ document.all.tags("DIV"); alert('Works in IE');}
else if (document.all || document.layers)
{ document.all.tags("DIV");}
else if (document.getElementByTag && document.all)
{ document.getElementById("DIV");}
else if (document.getElementByTag && !document.all)
{ document.getElementById("DIV");}
else if (document.getElementByTag)
{ document.getElementById("DIV");}
else
{ alert('Sorry, One of our main navigation systems does not support
your browser.'); }
}
Please, can anyone help me fix this above script so that it will work?
Regards
Lee