Posted By:
Nitesh_Naveen
Posted On:
Wednesday, April 16, 2003 03:20 AM
To start with your checking for ns6 will be true for IE5.5+ also. so for IE higher version kinda both will be executed whcih will be a waste of processor time!!!could be better to check like...
ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false
ns6 = (document.getElementById && !ie4)? true:false
Also you could modify your show_menu as:
function show_menu(item) {
hide_all();
if (ie4)
document.all[item].style.visibility = "visible";
else if (ns4)
document.layers[item].visibility = "show";
else
document.getElementById(item).style.visibility = "visible";
}
(note the usage of document.all - this should be how you use it) This should work fine in Netscape also (provided you have set the position as relative/absolute for teh div in case of Netscape 4x versions)
The function delay_hide will give an error in Netscape 4x since window.event is not defined. you should probably check for the ie4 flag also in that function