Click to See Complete Forum and Search --> : drop down menu not working in ie


jananraj
05-23-2009, 06:22 AM
<script language="javascript" type="text/javascript">

window.onerror = null;
var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
var menuActive = 0;
var menuOn = 0;
var onLayer;
var timeOn = null;

function showLayer(layerName,aa){
var x =document.getElementById(aa);
var tt =findPosX(x);
var ww =findPosY(x)+20;

if (timeOn != null) {
clearTimeout(timeOn);
hideLayer(onLayer);
}
if (IE4) {
var layers = eval('document.all["'+layerName+'"].style');
layers.left = tt;
eval('document.all["'+layerName+'"].style.visibility="visible"');
}
else {
if(document.getElementById){
var elementRef = document.getElementById(layerName);
if((elementRef.style)&& (elementRef.style.visibility!=null)){
elementRef.style.visibility = 'visible';
elementRef.style.left = tt;
elementRef.style.top = ww;
}
}
}
onLayer = layerName
}

function hideLayer(layerName){
if (menuActive == 0)
{
if (IE4){
eval('document.all["'+layerName+'"].style.visibility="hidden"');
}
else{
if(document.getElementById){
var elementRef = document.getElementById(layerName);
if((elementRef.style)&& (elementRef.style.visibility!=null)){
elementRef.style.visibility = 'hidden';
}
}
}
}
}

function btnTimer() {
timeOn = setTimeout("btnOut()",600)
}

function btnOut(layerName){
if (menuActive == 0){
hideLayer(onLayer)
}
}

var item;
function menuOver(itemName,ocolor){
item=itemName;
itemName.style.backgroundColor = ocolor; //background color change on mouse over
clearTimeout(timeOn);
menuActive = 0
}

function menuOut(itemName,ocolor){
if(item)
itemName.style.backgroundColor = ocolor;
menuActive = 0
timeOn = setTimeout("hideLayer(onLayer)", 100)
}

function findPosX(obj)
{
var curleft = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}
else if (obj.x)
curleft += obj.x;
return curleft;
}

function findPosY(obj)
{
var curtop = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curtop += obj.offsetTop
obj = obj.offsetParent;
}
}
else if (obj.y)
curtop += obj.y;
return curtop;
}

</script>

html part

<table valign=top cellpadding=0 cellspacing=0 width=100% border=0>
<tr><td bgcolor=#F7EBB1>
<table align=center><tr>
<td id=0 align=center class=cur> <b>HOME</b></td>
<td style="color: #ffffff;"> &nbsp; || &nbsp; </td><td id=1 align=center onmouseout=btnTimer() onmouseover=showLayer("Menu1",'1') class=menu> <b>about dr</b></td>
<td style="color: #ffffff;"> &nbsp; || &nbsp; </td><td id=2 align=center onmouseout=btnTimer() onmouseover=showLayer("Menu2",'2') class=menu> <b>ayurvead</b></td>
<td style="color: #ffffff;"> &nbsp; || &nbsp; </td><td id=3 align=center onmouseout=btnTimer() onmouseover=showLayer("Menu3",'3') class=menu> <b>vedicyoga</b></td>
<td style="color: #ffffff;"> &nbsp; || &nbsp; </td><td id=4 align=center onmouseout=btnTimer() onmouseover=showLayer("Menu4",'4') class=menu> <b>contact us</b></td>


</tr></table>



<div id=Menu1 style="position: absolute; border: 1px solid #000000; visibility:hidden; z-ndex: 1">
<table bgcolor=#ffeecc cellspacing=0 cellpadding=0 style="border-collapse: collapse;">
<tr height=25 onmouseout=menuOut(this,'#ffeecc') onmouseover=menuOver(this,'#FFFFFF')>
<td bgcolor=#000000>&nbsp; &nbsp;</td><td align=left>
<a class=asd href="dfsadf"> &nbsp;dr krishna varma &nbsp;</a> &nbsp; &nbsp;</td></tr>
<tr height=25 onmouseout=menuOut(this,'#ffeecc') onmouseover=menuOver(this,'#FFFFFF')>
<td bgcolor=#000000>&nbsp; &nbsp;</td><td align=left>
<a class=asd href="dsff"> &nbsp;dr velvizhi &nbsp;</a> &nbsp; &nbsp;</td></tr>
<tr height=25 onmouseout=menuOut(this,'#ffeecc') onmouseover=menuOver(this,'#FFFFFF')>
<td bgcolor=#000000>&nbsp; &nbsp;</td><td align=left>
<a class=asd href="dsff"> &nbsp;dr velmani &nbsp;</a> &nbsp; &nbsp;</td></tr>
</table></div>
<div id=Menu2 style="position: absolute; border: 1px solid #000000; visibility:hidden; z-ndex: 1">
<table bgcolor=#ffeecc cellspacing=0 cellpadding=0 style="border-collapse: collapse;">
<tr height=25 onmouseout=menuOut(this,'#ffeecc') onmouseover=menuOver(this,'#FFFFFF')>
<td bgcolor=#000000>&nbsp; &nbsp;</td><td align=left>
<a class=asd href="about ayurveda.htm"> &nbsp;about &nbsp;</a> &nbsp; &nbsp;</td></tr>
<tr height=25 onmouseout=menuOut(this,'#ffeecc') onmouseover=menuOver(this,'#FFFFFF')>
<td bgcolor=#000000>&nbsp; &nbsp;</td><td align=left>
<a class=asd href="fdsdf"> &nbsp;sareera shudhi &nbsp;</a> &nbsp; &nbsp;</td></tr>
<tr height=25 onmouseout=menuOut(this,'#ffeecc') onmouseover=menuOver(this,'#FFFFFF')>
<td bgcolor=#000000>&nbsp; &nbsp;</td><td align=left>
<a class=asd href="fdsdf"> &nbsp;mano shudhi &nbsp;</a> &nbsp; &nbsp;</td></tr>
<tr height=25 onmouseout=menuOut(this,'#ffeecc') onmouseover=menuOver(this,'#FFFFFF')>
<td bgcolor=#000000>&nbsp; &nbsp;</td><td align=left>
<a class=asd href="fdsdf"> &nbsp;athma shudhi &nbsp;</a> &nbsp; &nbsp;</td></tr>

</table></div>
<div id=Menu3 style="position: absolute; border: 1px solid #000000; visibility:hidden; z-ndex: 1">
<table bgcolor=#ffeecc cellspacing=0 cellpadding=0 style="border-collapse: collapse;">
<tr height=25 onmouseout=menuOut(this,'#ffeecc') onmouseover=menuOver(this,'#FFFFFF')>
<td bgcolor=#000000>&nbsp; &nbsp;</td><td align=left>
<a class=asd href="sdfdsf"> &nbsp;classes &nbsp;</a> &nbsp; &nbsp;</td></tr>

<tr height=25 onmouseout=menuOut(this,'#ffeecc') onmouseover=menuOver(this,'#FFFFFF')>
<td bgcolor=#000000>&nbsp; &nbsp;</td><td align=left>
<a class=asd href="sdfdsf"> &nbsp;standing &nbsp;</a> &nbsp; &nbsp;</td></tr>
<tr height=25 onmouseout=menuOut(this,'#ffeecc') onmouseover=menuOver(this,'#FFFFFF')>
<td bgcolor=#000000>&nbsp; &nbsp;</td><td align=left>
<a class=asd href="fdsdf"> &nbsp;sitting &nbsp;</a> &nbsp; &nbsp;</td></tr>
<tr height=25 onmouseout=menuOut(this,'#ffeecc') onmouseover=menuOver(this,'#FFFFFF')>
<td bgcolor=#000000>&nbsp; &nbsp;</td><td align=left>
<a class=asd href="fdsdf"> &nbsp;lying back &nbsp;</a> &nbsp; &nbsp;</td></tr>
<tr height=25 onmouseout=menuOut(this,'#ffeecc') onmouseover=menuOver(this,'#FFFFFF')>
<td bgcolor=#000000>&nbsp; &nbsp;</td><td align=left>
<a class=asd href="fdsdf"> &nbsp;lying front &nbsp;</a> &nbsp; &nbsp;</td></tr>
</table></div>
<div id=Menu4 style="position: absolute; border: 1px solid #000000; visibility:hidden; z-ndex: 1">
<table bgcolor=#ffeecc cellspacing=0 cellpadding=0 style="border-collapse: collapse;">
<tr height=25 onmouseout=menuOut(this,'#ffeecc') onmouseover=menuOver(this,'#FFFFFF')>
<td bgcolor=#000000>&nbsp; &nbsp;</td><td align=left>
<a class=asd href="sdfdsf"> &nbsp;sdfdsf &nbsp;</a> &nbsp; &nbsp;</td></tr>
<tr height=25 onmouseout=menuOut(this,'#ffeecc') onmouseover=menuOver(this,'#FFFFFF')>
<td bgcolor=#000000>&nbsp; &nbsp;</td><td align=left>
<a class=asd href="fdsdf"> &nbsp;sdff &nbsp;</a> &nbsp; &nbsp;</td></tr>
</table></div>


please help me.