I have an old code in a website which shows roll over menu on mouse over event. Now it is not working in FF, Chrome and Safari. only works in IE. Below is the code snippet
Code:
// layerTest class
<div class=menu id=layerTest style="width: 47; height: 8; layer-background-color: #FFFFFF; border: 1px none #000000; background-color: #FFFFFF"></div>
// Below is the HTML tag for image to show the menu on mouse over function when the functions mentioned in the tag are called on mouseover or mousout event
<td valign="bottom" width="75" height="15" >
<a href="#" onMouseOut="timer(0);" onMouseOver="activateMenu(1,'tools',30,19); timer(1);MM_swapImgRestore();MM_swapImage('profile','','images/comp_btn_ov.gif',1)"><img src="images/comp_btn.gif" border="0" name="profile" width="75" height="19"></a>
</td>
// Below is the defination of activateMenu function in javascript include page
function activateMenu(menuLayerRef, imageName, left, top)
{
var lightsout
// I think problem is in a below mentioned line
var isDynamic = ( ((document.layers && document.layers['layerTest']) || (document.all && document.all['layerTest'])) && !isMacIE );
// layerTest CLASS is define at the starting of this code
if (isDynamic && activeMenu != menuLayerRef) {
if (activeMenu) hideMenu("menu" + activeMenu);
menuID = "menu" + menuLayerRef;
activeMenu = menuLayerRef;
if (isNS) {
document[menuID].left = getXCoord(imageName) + left;
document[menuID].top = getYCoord(imageName) + top;
}
else {
document.all[menuID].style.pixelLeft = getXCoord(imageName) + left;
document.all[menuID].style.pixelTop = getYCoord(imageName) + top;
}
showMenu(menuID, left, top)
}
}
function showMenu(layerID, left, top) {
eval(layerRef + '["' + layerID + '"]' +
styleRef + '.visibility = "visible"');
}
Comment