mminorhsd
Programmer
- Apr 16, 2013
- 2
The javascript listed below works fine in IE, but not chrome, firefox or safari. It creates a drop down menu, hiding the menu options until you mouseover the top layer of one of the menu options. I have tested it with various online validator sites and it doesn't show any errors. Is there something in it that Chrome, FF and Safari doesn't support?
<SCRIPT LANGUAGE=JAVASCRIPT TYPE=text/JAVASCRIPT>
<!--
No3 = (parseInt(navigator.appVersion,10) > 3) ? 1:0;
layer = (document.all && No3) ? "document.all['L'+menu].style" : (document.layers && No3) ? "document.layers['L'+menu]" : 0;
var timer;
function Show() { if(layer) {
if(timer) { clearTimeout(timer); }
for(menu=0; menu<Layer.length; menu++) { if(Layer[menu]) { eval(layer).visibility = "hidden"; } }
for(i=0; i<arguments.length; i++) { menu=arguments; eval(layer).visibility = "visible"; }
} }
function Hide() { timer = setTimeout("Show()", 500); }
//-->
</SCRIPT>
<P></P msnavigation></SPAN></TD></TR></TBODY msnavigation></TABLE><DIV ALIGN=CENTER>
<TABLE border="1" cellpadding="0" cellspacing="0" WIDTH="900" HEIGHT="17" bgcolor=#4682B4 bordercolordark="#FFFFFF" bordercolor="#000080" bordercolorlight="#C0C0C0">
<tr>
<td WIDTH="150" align="center" bgcolor="#999999" ><b><A onmouseover=Show(1) onmouseout=Hide(1) HREF=" of Sale</A></b></td>
<td WIDTH="150" align="center" bgcolor="#999999" ><b><A onmouseover=Show(2) onmouseout=Hide(2) HREF=" Book</A></b></td>
</tr>
</TABLE>
<SCRIPT LANGUAGE=JAVASCRIPT>
<!--
//////////////////////////////////////////////////////
hovercolor = "#CCCCCC"; // color name/code
bgcolor = "#999999"; // color name/code
background = ""; // picture url
menu_border = 1; // IE only
border_color = "white"; // IE only
arrow_pic = " // url of arrow picture for submenus
//////////////////////////////////////////////////////
if(document.all) { if(!background) { background=bgcolor; } else { background = "url("+background+")"; } }
function LayerSpecs(Left,Top,Width) { if(No3) {
if(document.all) { Top+=7; Left+=2; Width+=56; }
this.left = Left;
this.top = Top;
this.info = "";
T=0;
for(i=3; i<arguments.length; i++) {
if(document.all) { this.info += "<TR><TD WIDTH="+Width+" onMouseOver='this.bgColor=\""+hovercolor+"\"' onMouseOut='this.bgColor=\"\"'>"+arguments+"</TD></TR>"; }
else { this.info += "<LAYER onMouseOver='this.bgColor=\""+hovercolor+"\"' onMouseOut='this.bgColor=\""+bgcolor+"\"' WIDTH="+Width+" POSITION=RELATIVE TOP="+T+"> "+arguments+"</LAYER>"; }
T+=20;
}
} }
Layer = new Array();
arrow = "<IMG SRC='"+arrow_pic+"' WIDTH=6 HEIGHT=10 BORDER=0 ALT=''>";
//////////////////////////////////////////////
Layer[1] = new LayerSpecs(70,24,140,
'<img border="0" src=" width="13" height="12"><A HREF= </A>',
'<img border="0" src=" width="13" height="12"><A HREF= Out Day </A>');
Layer[2] = new LayerSpecs(205,24,140,
'<img border="0" src=" width="13" height="12"><A HREF= Appointment </A>',
'<img border="0" src=" width="13" height="12"><A HREF= Appointments </A>');
////////////////////////////////////////////////////////////////
j = (Layer[0]) ? 0:1;
for(i=j; i<Layer.length; i++) {
if(document.all && No3) { document.write("<SPAN onMouseOver='clearTimeout(timer)' onMouseOut='Hide("+i+")' ID='L"+i+"' STYLE='position:absolute; visibility:hidden; background:"+background+"; top:"+Layer.top+"; left:"+Layer.left+";'><TABLE STYLE='border:solid "+menu_border+" "+border_color+"'>"+Layer.info+"</TABLE></SPAN>"); }
else if(document.layers && No3) { document.write("<LAYER onMouseOver='clearTimeout(timer)' onMouseOut='Hide("+i+")' ID='L"+i+"' POSITION=ABSOLUTE VISIBILITY=HIDDEN BGCOLOR='"+bgcolor+"' BACKGROUND='"+background+"' TOP="+Layer.top+" LEFT="+Layer.left+">"+Layer.info+"</LAYER>"); }
}
// -->
</SCRIPT>
any help will be greatly appreciated.
<SCRIPT LANGUAGE=JAVASCRIPT TYPE=text/JAVASCRIPT>
<!--
No3 = (parseInt(navigator.appVersion,10) > 3) ? 1:0;
layer = (document.all && No3) ? "document.all['L'+menu].style" : (document.layers && No3) ? "document.layers['L'+menu]" : 0;
var timer;
function Show() { if(layer) {
if(timer) { clearTimeout(timer); }
for(menu=0; menu<Layer.length; menu++) { if(Layer[menu]) { eval(layer).visibility = "hidden"; } }
for(i=0; i<arguments.length; i++) { menu=arguments; eval(layer).visibility = "visible"; }
} }
function Hide() { timer = setTimeout("Show()", 500); }
//-->
</SCRIPT>
<P></P msnavigation></SPAN></TD></TR></TBODY msnavigation></TABLE><DIV ALIGN=CENTER>
<TABLE border="1" cellpadding="0" cellspacing="0" WIDTH="900" HEIGHT="17" bgcolor=#4682B4 bordercolordark="#FFFFFF" bordercolor="#000080" bordercolorlight="#C0C0C0">
<tr>
<td WIDTH="150" align="center" bgcolor="#999999" ><b><A onmouseover=Show(1) onmouseout=Hide(1) HREF=" of Sale</A></b></td>
<td WIDTH="150" align="center" bgcolor="#999999" ><b><A onmouseover=Show(2) onmouseout=Hide(2) HREF=" Book</A></b></td>
</tr>
</TABLE>
<SCRIPT LANGUAGE=JAVASCRIPT>
<!--
//////////////////////////////////////////////////////
hovercolor = "#CCCCCC"; // color name/code
bgcolor = "#999999"; // color name/code
background = ""; // picture url
menu_border = 1; // IE only
border_color = "white"; // IE only
arrow_pic = " // url of arrow picture for submenus
//////////////////////////////////////////////////////
if(document.all) { if(!background) { background=bgcolor; } else { background = "url("+background+")"; } }
function LayerSpecs(Left,Top,Width) { if(No3) {
if(document.all) { Top+=7; Left+=2; Width+=56; }
this.left = Left;
this.top = Top;
this.info = "";
T=0;
for(i=3; i<arguments.length; i++) {
if(document.all) { this.info += "<TR><TD WIDTH="+Width+" onMouseOver='this.bgColor=\""+hovercolor+"\"' onMouseOut='this.bgColor=\"\"'>"+arguments+"</TD></TR>"; }
else { this.info += "<LAYER onMouseOver='this.bgColor=\""+hovercolor+"\"' onMouseOut='this.bgColor=\""+bgcolor+"\"' WIDTH="+Width+" POSITION=RELATIVE TOP="+T+"> "+arguments+"</LAYER>"; }
T+=20;
}
} }
Layer = new Array();
arrow = "<IMG SRC='"+arrow_pic+"' WIDTH=6 HEIGHT=10 BORDER=0 ALT=''>";
//////////////////////////////////////////////
Layer[1] = new LayerSpecs(70,24,140,
'<img border="0" src=" width="13" height="12"><A HREF= </A>',
'<img border="0" src=" width="13" height="12"><A HREF= Out Day </A>');
Layer[2] = new LayerSpecs(205,24,140,
'<img border="0" src=" width="13" height="12"><A HREF= Appointment </A>',
'<img border="0" src=" width="13" height="12"><A HREF= Appointments </A>');
////////////////////////////////////////////////////////////////
j = (Layer[0]) ? 0:1;
for(i=j; i<Layer.length; i++) {
if(document.all && No3) { document.write("<SPAN onMouseOver='clearTimeout(timer)' onMouseOut='Hide("+i+")' ID='L"+i+"' STYLE='position:absolute; visibility:hidden; background:"+background+"; top:"+Layer.top+"; left:"+Layer.left+";'><TABLE STYLE='border:solid "+menu_border+" "+border_color+"'>"+Layer.info+"</TABLE></SPAN>"); }
else if(document.layers && No3) { document.write("<LAYER onMouseOver='clearTimeout(timer)' onMouseOut='Hide("+i+")' ID='L"+i+"' POSITION=ABSOLUTE VISIBILITY=HIDDEN BGCOLOR='"+bgcolor+"' BACKGROUND='"+background+"' TOP="+Layer.top+" LEFT="+Layer.left+">"+Layer.info+"</LAYER>"); }
}
// -->
</SCRIPT>
any help will be greatly appreciated.