请帮我看一下javascript代码,在IE6下可以,IE7和Firefox不行
因为代码太长不能把所有的源文件贴上具体请查看如下页面http://www.golden-book.com/faq/help/help.shtml<SCRIPTlangua...
因为代码太长不能把所有的源文件贴上具体请查看如下页面http://www.golden-book.com/faq/help/help.shtml
<SCRIPT language=javascript>
function menuShow(obj,maxh,obj2)
{
if(obj.style.pixelHeight<maxh)
{
obj.style.pixelHeight+=maxh/5;
obj.filters.alpha.opacity+=20;
if(obj.style.pixelHeight==maxh/5)
obj.style.display='block';
obj2.className="menu_title2";
myObj=obj;
myMaxh=maxh;
myObj2=obj2;
setTimeout('menuShow(myObj,myMaxh,myObj2)','5');
}
}
function menuHide(obj,maxh,obj2)
{
if(obj.style.pixelHeight>0)
{
if(obj.style.pixelHeight==maxh/1)
obj.style.display='none';
obj.style.pixelHeight-=maxh/1;
obj.filters.alpha.opacity-=5;
obj2.className="menu_title";
myObj=obj;
myMaxh=maxh
myObj2=obj2;
setTimeout('menuHide(myObj,myMaxh,myObj2)','5');
}
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>
非常感谢你,IE7也可以了,你按您的要求改了,http://www.golden-book.com/faq/help/help.shtml 但为什么点击切换不自动隐藏啊! 我的邮箱是wangji@pl-kids.com 展开
<SCRIPT language=javascript>
function menuShow(obj,maxh,obj2)
{
if(obj.style.pixelHeight<maxh)
{
obj.style.pixelHeight+=maxh/5;
obj.filters.alpha.opacity+=20;
if(obj.style.pixelHeight==maxh/5)
obj.style.display='block';
obj2.className="menu_title2";
myObj=obj;
myMaxh=maxh;
myObj2=obj2;
setTimeout('menuShow(myObj,myMaxh,myObj2)','5');
}
}
function menuHide(obj,maxh,obj2)
{
if(obj.style.pixelHeight>0)
{
if(obj.style.pixelHeight==maxh/1)
obj.style.display='none';
obj.style.pixelHeight-=maxh/1;
obj.filters.alpha.opacity-=5;
obj2.className="menu_title";
myObj=obj;
myMaxh=maxh
myObj2=obj2;
setTimeout('menuHide(myObj,myMaxh,myObj2)','5');
}
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>
非常感谢你,IE7也可以了,你按您的要求改了,http://www.golden-book.com/faq/help/help.shtml 但为什么点击切换不自动隐藏啊! 我的邮箱是wangji@pl-kids.com 展开
展开全部
您好,感谢您对火狐的支持
使用Firebug调试下就容易发现问题,onClick="menuChange(menu1,170,menuTitle1);"
改为:
onClick="menuChange('menu1',170,'menuTitle1');"注意符号。
您可以在火狐官方网站下载火狐浏览器,在火狐社区了解更多内容。希望我的回答对您有所帮助,如有疑问,欢迎继续在本平台咨询。
使用Firebug调试下就容易发现问题,onClick="menuChange(menu1,170,menuTitle1);"
改为:
onClick="menuChange('menu1',170,'menuTitle1');"注意符号。
您可以在火狐官方网站下载火狐浏览器,在火狐社区了解更多内容。希望我的回答对您有所帮助,如有疑问,欢迎继续在本平台咨询。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
字数有限制,我把有改动的贴上来吧,在firefox和ie6测试过,ie7没装
.sec_menu {display:block;BORDER-RIGHT: white 1px solid; BACKGROUND: #fbfbfc; OVERFLOW: hidden; BORDER-LEFT: white 1px solid; BORDER-BOTTOM: white 1px solid; padding-left:15px;}
<SCRIPT language=javascript>
function menuShow(obj,maxh,obj2)
{
if(obj.clientHeight<maxh)
{
obj.style.height =obj.clientHeight+maxh/5+"px";
obj.style.display='block';
obj.style.filter="alpha(opacity="+(opacity+=20)+")";
obj.style.opacity=opacity/100;
obj2.className="menu_title2";
myObj=obj;
myMaxh=maxh;
myObj2=obj2;
setTimeout('menuShow(myObj,myMaxh,myObj2)',5);
}
}
function menuHide(obj,maxh,obj2)
{
if(obj.clientHeight>0)
{
obj.style.height ="0";
obj.style.filter="alpha(opacity=0)";
obj.style.opacity="0.0";
obj2.className="menu_title";
myObj=obj;
myMaxh=maxh;
myObj2=obj2;
setTimeout('menuHide(myObj,myMaxh,myObj2)',5);
}
else
if(whichContinue)
whichContinue.onclick();
}
function menuChange(o,maxh,o2)
{
obj=document.getElementById(o);
obj2=document.getElementById(o2);
if(obj.clientHeight)
{
menuHide(obj,maxh,obj2);
whichOpen="";
whichcontinue="";
}
else
if(whichOpen)
{
whichContinue=obj2;
whichOpen.onclick();
}
else
{
opacity=0;
menuShow(obj,maxh,obj2);
whichOpen=obj2;
whichContinue="";
}
}
</SCRIPT>
<TD class="menu_title" id="menuTitle1" onClick="menuChange('menu1',170,'menuTitle1');" ><SPAN>新手上路</SPAN> </TD>
注意
onClick="menuChange(menu1,170,menuTitle1);"
变成了
onClick="menuChange('menu1',170,'menuTitle1');"
一直到
<TD class="menu_title" id="menuTitle8" onClick="menuChange('menu8',60,'menuTitle8');"><SPAN>客户购物保障</SPAN> </TD>
或者留个邮箱
.sec_menu {display:block;BORDER-RIGHT: white 1px solid; BACKGROUND: #fbfbfc; OVERFLOW: hidden; BORDER-LEFT: white 1px solid; BORDER-BOTTOM: white 1px solid; padding-left:15px;}
<SCRIPT language=javascript>
function menuShow(obj,maxh,obj2)
{
if(obj.clientHeight<maxh)
{
obj.style.height =obj.clientHeight+maxh/5+"px";
obj.style.display='block';
obj.style.filter="alpha(opacity="+(opacity+=20)+")";
obj.style.opacity=opacity/100;
obj2.className="menu_title2";
myObj=obj;
myMaxh=maxh;
myObj2=obj2;
setTimeout('menuShow(myObj,myMaxh,myObj2)',5);
}
}
function menuHide(obj,maxh,obj2)
{
if(obj.clientHeight>0)
{
obj.style.height ="0";
obj.style.filter="alpha(opacity=0)";
obj.style.opacity="0.0";
obj2.className="menu_title";
myObj=obj;
myMaxh=maxh;
myObj2=obj2;
setTimeout('menuHide(myObj,myMaxh,myObj2)',5);
}
else
if(whichContinue)
whichContinue.onclick();
}
function menuChange(o,maxh,o2)
{
obj=document.getElementById(o);
obj2=document.getElementById(o2);
if(obj.clientHeight)
{
menuHide(obj,maxh,obj2);
whichOpen="";
whichcontinue="";
}
else
if(whichOpen)
{
whichContinue=obj2;
whichOpen.onclick();
}
else
{
opacity=0;
menuShow(obj,maxh,obj2);
whichOpen=obj2;
whichContinue="";
}
}
</SCRIPT>
<TD class="menu_title" id="menuTitle1" onClick="menuChange('menu1',170,'menuTitle1');" ><SPAN>新手上路</SPAN> </TD>
注意
onClick="menuChange(menu1,170,menuTitle1);"
变成了
onClick="menuChange('menu1',170,'menuTitle1');"
一直到
<TD class="menu_title" id="menuTitle8" onClick="menuChange('menu8',60,'menuTitle8');"><SPAN>客户购物保障</SPAN> </TD>
或者留个邮箱
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询