js在火狐、谷歌等浏览器内的问题!
我做的一个左导航栏,在IE或世界之窗内能正常使用,可是一到火狐、谷歌、Opera这几个浏览器就不能下拉层了!请高手帮帮忙~!<head><SCRIPTlanguage=j...
我做的一个左导航栏,在IE或世界之窗内能正常使用,可是一到火狐、谷歌、Opera这几个浏览器就不能下拉层了!请高手帮帮忙~!
<head>
<SCRIPT language=javascript>
function menuShow(obj,maxh,obj2)
{ if(obj.style.pixelHeight<maxh)
{ obj.style.pixelHeight+=maxh/20;
obj.filters.alpha.opacity+=5;
if(obj.style.pixelHeight==maxh/10)
obj.style.display='block';
myObj=obj;
myMaxh=maxh;
myObj2=obj2;
setTimeout('menuShow(myObj,myMaxh,myObj2)','15');
}
}function menuHide(obj,maxh,obj2)
{ if(obj.style.pixelHeight>0)
{ if(obj.style.pixelHeight==maxh/20)
obj.style.display='none';
obj.style.pixelHeight-=maxh/20;
obj.filters.alpha.opacity-=5;
myObj=obj;
myMaxh=maxh
myObj2=obj2;
setTimeout('menuHide(myObj,myMaxh,myObj2)','15');
} else
if(whichContinue)
whichContinue.click();
}function menuChange(obj,maxh,obj2){
if(obj.style.pixelHeight)
{ menuHide(obj,maxh,obj2);
whichOpen=''; whichcontinue='';
} else
if(whichOpen) {
whichContinue=obj2;
whichOpen.click();
} else
{ menuShow(obj,maxh,obj2);
whichOpen=obj2;
whichContinue=''; }
}
</SCRIPT>
</head>
<body>
<TABLE cellSpacing="0" cellPadding="0" width="165" align="center">
<tr>
<td height="24" align="center" valign="middle" background="images/menu_bg.gif" id="menuTitle10" onClick="menuChange(menu10,100,menuTitle10)" style="cursor:hand;"><span class="STYLE3">栏目</span></td>
</tr>
</TABLE>
<DIV class="sec_menu" id="menu10" style="DISPLAY: none; FILTER: alpha(Opacity=0); WIDTH: 165px; HEIGHT: 0px;" align="center">
<TABLE cellSpacing="0" cellPadding="0" align="center" border=0 bordercolor="#ffffff" width=167 height=100%>
<tr>
<td width=2>
</td>
<td width=99% height=100%>
<table cellSpacing="0" cellPadding="0" border=0 width=100% height=100% align=center class="yinchang">
<tr>
<td height="24" align="center" valign="middle">标题</td>
</tr>
</table>
</td>
</tr>
</table>
</DIV>
</body> 展开
<head>
<SCRIPT language=javascript>
function menuShow(obj,maxh,obj2)
{ if(obj.style.pixelHeight<maxh)
{ obj.style.pixelHeight+=maxh/20;
obj.filters.alpha.opacity+=5;
if(obj.style.pixelHeight==maxh/10)
obj.style.display='block';
myObj=obj;
myMaxh=maxh;
myObj2=obj2;
setTimeout('menuShow(myObj,myMaxh,myObj2)','15');
}
}function menuHide(obj,maxh,obj2)
{ if(obj.style.pixelHeight>0)
{ if(obj.style.pixelHeight==maxh/20)
obj.style.display='none';
obj.style.pixelHeight-=maxh/20;
obj.filters.alpha.opacity-=5;
myObj=obj;
myMaxh=maxh
myObj2=obj2;
setTimeout('menuHide(myObj,myMaxh,myObj2)','15');
} else
if(whichContinue)
whichContinue.click();
}function menuChange(obj,maxh,obj2){
if(obj.style.pixelHeight)
{ menuHide(obj,maxh,obj2);
whichOpen=''; whichcontinue='';
} else
if(whichOpen) {
whichContinue=obj2;
whichOpen.click();
} else
{ menuShow(obj,maxh,obj2);
whichOpen=obj2;
whichContinue=''; }
}
</SCRIPT>
</head>
<body>
<TABLE cellSpacing="0" cellPadding="0" width="165" align="center">
<tr>
<td height="24" align="center" valign="middle" background="images/menu_bg.gif" id="menuTitle10" onClick="menuChange(menu10,100,menuTitle10)" style="cursor:hand;"><span class="STYLE3">栏目</span></td>
</tr>
</TABLE>
<DIV class="sec_menu" id="menu10" style="DISPLAY: none; FILTER: alpha(Opacity=0); WIDTH: 165px; HEIGHT: 0px;" align="center">
<TABLE cellSpacing="0" cellPadding="0" align="center" border=0 bordercolor="#ffffff" width=167 height=100%>
<tr>
<td width=2>
</td>
<td width=99% height=100%>
<table cellSpacing="0" cellPadding="0" border=0 width=100% height=100% align=center class="yinchang">
<tr>
<td height="24" align="center" valign="middle">标题</td>
</tr>
</table>
</td>
</tr>
</table>
</DIV>
</body> 展开
3个回答
展开全部
您好!很高兴为您答疑。
走读了一下您的代码,发现obj.style.pixelHeight这类dhtml对象索引语法,而火狐等浏览器下,要想进行对象获取,需要或者采用jQuery框架,或者采用原生的dom对象,因此您的代码在火狐浏览器下无法兼容。
如果对我们的回答存在任何疑问,欢迎继续问询。
走读了一下您的代码,发现obj.style.pixelHeight这类dhtml对象索引语法,而火狐等浏览器下,要想进行对象获取,需要或者采用jQuery框架,或者采用原生的dom对象,因此您的代码在火狐浏览器下无法兼容。
如果对我们的回答存在任何疑问,欢迎继续问询。
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这个没办法,是浏览器不兼容js
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询