Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bloody browser incompatibility.

Status
Not open for further replies.

trc

MIS
Nov 27, 2000
126
CA
I inherited this problem from my predessor and do not have the necessary experience in JavaScript to deal with it. This chunk of code does not work in anything except IE for PC. At least part of the problem is cancelBubble. It is not supported in Netscape. What do I do to fix it? I tried below in the Netscape check are but it does not work.


The call to this function comes in the ahref tag like this. ....id="mnuHOME2"; doMenu('mpuHOME2')....


function doMenu(MenuIDStr) {
var thisMenu = document.getElementById(MenuIDStr);
if (document.all) {//IE Check
if (ToolbarMenu == null || thisMenu == null || thisMenu == ToolbarMenu) { window.event.cancelBubble = true; return false; }
// Reset dropdown menu
window.event.cancelBubble = true;
ToolbarMenu.style.display = "none";
ToolbarMenu = thisMenu;
// Set dropdown menu display position
x = window.event.srcElement.offsetLeft + window.event.srcElement.offsetParent.offsetLeft - 8;
x2 = x + window.event.srcElement.offsetWidth;
y = window.event.srcElement.offsetTop + window.event.srcElement.offsetHeight + 4;
thisMenu.style.top = y;
thisMenu.style.left = x;
thisMenu.style.clip = "rect(0 0 0 0)";
thisMenu.style.display = "block";
// delay 2 millsecond to allow the value of ToolbarMenu.offsetHeight be set
window.setTimeout("showMenu()", 2);
return true;
}// end if for IE Check

if (document.layer | document.getElementById) { //Netscape Check
if (ToolbarMenu == null || thisMenu == null || thisMenu == ToolbarMenu)
// Reset dropdown menu
if (eval(MenuIDStr.id)==false)
{
MenuIDStr.innerhtml=document.all[MenuIDStr.iD].innerhtml;
eval(MenuIDStr.id="true");
}
else
{
MenuIDStr.children[0].outerhtml='';
eval(MenuIDStr.id="false");
}
}// end if for Netscape Check
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top