当前位置:编程学习 > C#/ASP.NET >>

这个tab切换在火狐里面不兼容怎么改?

这是js代码

//*Tab 懸浮切换
function tabit(btn){
var idname = new String(btn.id);
var s = idname.indexOf("_");
var e = idname.lastIndexOf("_")+1;
var tabName = idname.substr(0, s);
var id = parseInt(idname.substr(e, 1));
var tabNumber = btn.parentNode.childNodes.length;
for(i=0;i<tabNumber;i++){
document.getElementById(tabName+"_div_"+i).style.display = "none";
document.getElementById(tabName+"_btn_"+i).className = "";
};
document.getElementById(tabName+"_div_"+id).style.display = "block";
btn.className = "curr";//添加class

};

--------------------编程问答-------------------- 这是 html代码


  <div class="midmenu">
                        <div class="tbtncon tbtn1">
                            <ul class="llst">
                                <li id="tabap1_btn_0" class="curr" onmouseover="tabit(this)" style="border-right: 0px">ERP系统</li>
                                <li id="tabap1_btn_1" onmouseover="tabit(this)" style="border-right: 0px">CRM系统</li>
                                <li id="tabap1_btn_2" onmouseover="tabit(this)" style="border-right: 0px">进销存系统</li>
                                <li id="tabap1_btn_3" onmouseover="tabit(this)" style="border-right: 0px">项目管理系统</li>
                            </ul>
                        </div>
                    </div>
                    <div class="midinfo">
                        <div id="tabap1_div_0">
                            <ul class="llst02">
                                <li class="midtops">
                                    <div class="midtopleft">
                                        <a title="ERP系统" href="javascript:void(0)">
                                            <img src="images/02.jpg" alt="" /></a></div>
                                    <div class="midtopr big">
                                        <a title="ERP系统" href="javascript:void(0)">ERP系统</a></div>
                                    <div class="midtoprr">
                                        将客户关系、库存、财务、办公管理完美融合;互联网、局域网皆可使用。包含CRM、项目管理系统、进销存系统的所有功能,在一套系统内解决企业所有的管理问题,全程监控企业的运转和协作。</div>
                                    <div class="midtoprr">
                                        <a onmouseover="MM_swapImage('Image60','','images/b01.gif',1)" onmouseout="MM_swapImgRestore()"
                                            href="javascript:void(0)">
                                            <img id="Image60" border="0" name="Image60" alt="详细了解ERP系统" src="images/b1.gif" /></a>
                                        <a onmouseover="MM_swapImage('Image62','','images/b02.gif',1)" onmouseout="MM_swapImgRestore()"
                                            href="javascript:void(0)">
                                            <img id="Image62" border="0" name="Image62" alt="文档下载" src="images/b2.gif" /></a>
                                        <a onmouseover="MM_swapImage('Image63','','images/b04.gif',1)" onmouseout="MM_swapImgRestore()"
                                            href="javascript:void(0)">
                                            <img id="Image63" border="0" name="Image63" alt="免费试用ERP系统" src="images/b03.gif" /></a></div>
                                </li>
                                <li class="midend">
                                    <div class="midtendi">
                                        <span class="STYLE1">管理应用套件:</span>客户关系管理(CRM)、项目管理(PM)、企业资源计划(ERP)、仓库管理(WM)、财务管理(FM)、行政办公(OA)、目标管理(MBO)、电子商务平台(IEBP)、知识及时通(IKM)、人力资源管理(HR)、知识管理(KM)、团队管理(TM)</div>
                                </li>
                            </ul>
                        </div>
                        <div style="display: none" id="tabap1_div_1">
                            <ul class="llst02">
                                <li class="midtops">
                                    <div class="midtopleft">
                                        <a title="CRM系统" href="#">
                                            <img src="images/01.jpg" alt="" /></a></div>
                                    <div class="midtopr big">
                                        <a title="CRM系统" href="javascript:void(0)">CRM系统</a></div>
                                    <div class="midtoprr">
                                        侧重客户关系和团队管理;互联网、局域网皆可使用。包括客户、联系人、对手、产品、合同、回款、售后、费用、日程、公告、知识库、备忘录、个性网址、图表统计、自动提醒、团队等功能模块。</div>
                                    <div class="midtoprr">
                                        <a onmouseover="MM_swapImage('Image70','','images/b01.gif',1)" onmouseout="MM_swapImgRestore()"
                                            href="javascript:void(0)">
                                            <img id="Image70" border="0" name="Image70" alt="详细了解CRM系统" src="images/b1.gif" /></a>
                                        <a onmouseover="MM_swapImage('Image72','','images/b02.gif',1)" onmouseout="MM_swapImgRestore()"
                                            href="javascript:void(0)">
                                            <img id="Image72" border="0" name="Image72" alt="文档下载" src="images/b2.gif" /></a>
                                        <a onmouseover="MM_swapImage('Image73','','images/b04.gif',1)" onmouseout="MM_swapImgRestore()"
                                            href="javascript:void(0)">
                                            <img id="Image73" border="0" name="Image73" alt="免费试用CRM系统" src="images/b03.gif" /></a></div>
                                </li>
                                <li class="midend">
                                    <div class="midtendi">
                                        <span class="STYLE1">管理应用套件:</span>客户关系管理(CRM)、项目管理(PM)、企业资源计划(ERP)、仓库管理(WM)、财务管理(FM)、行政办公(OA)、目标管理(MBO)、电子商务平台(IEBP)、知识及时通(IKM)、人力资源管理(HR)、知识管理(KM)、团队管理(TM)</div>
                                </li>
                            </ul>
                        </div>
                        <div style="display: none" id="tabap1_div_2">
                            <ul class="llst02">
                                <div class="midtops">
                                    <div class="midtopleft">
                                        <a title="进销存系统" href="javascript:void(0)">
                                            <img src="images/03.jpg" alt="" /></a></div>
                                    <div class="midtopr big">
                                        <a title="进销存系统" href="javascript:void(0)">进销存系统</a></div>
                                    <div class="midtoprr">
                                        侧重进货、库存和账款管理;互联网、局域网皆可使用。包括客户、采购、入库、出库、盘点、调拨、借货、还货、退货、预警、订单、回款、付款、售后、公告、备忘录、图表统计等功能模块。</div>
                                    <div class="midtoprr">
                                        <a onmouseover="MM_swapImage('Image80','','images/b01.gif',1)" onmouseout="MM_swapImgRestore()"
                                            href="javascript:void(0)">
                                            <img id="Image80" border="0" name="Image80" alt="详细了解进销存系统" src="images/b1.gif" /></a>
                                        <a onmouseover="MM_swapImage('Image82','','images/b02.gif',1)" onmouseout="MM_swapImgRestore()"
                                            href="javascript:void(0)">
                                            <img id="Image82" border="0" name="Image82" alt="文档下载" src="images/b2.gif" /></a>
                                        <a onmouseover="MM_swapImage('Image83','','images/b04.gif',1)" onmouseout="MM_swapImgRestore()"
                                            href="javascript:void(0)">
                                            <img id="Image83" border="0" name="Image83" alt="免费试用进销存系统" src="images/b03.gif" /></a></div>
                                </div>
                                <div class="midend">
                                    <div class="midtendi">
                                        <span class="STYLE1">管理应用套件:</span>客户关系管理(CRM)、项目管理(PM)、企业资源计划(ERP)、仓库管理(WM)、财务管理(FM)、行政办公(OA)、目标管理(MBO)、电子商务平台(IEBP)、知识及时通(IKM)、人力资源管理(HR)、知识管理(KM)、团队管理(TM)</div>
                                </div>
                            </ul>
                        </div>
                        <div style="display: none" id="tabap1_div_3">
                            <ul class="llst02">
                                <div class="midtops">
                                    <div class="midtopleft">
                                        <a title="项目管理系统" href="#">
                                            <img src="images/04.jpg" alt="" /></a></div>
                                    <div class="midtopr big">
                                        <a title="项目管理系统" href="#">项目管理系统</a></div>
                                    <div class="midtoprr">
                                        侧重客户关系和项目的管理;互联网、局域网皆可使用。包括客户、对手、项目、报价、合同、回款、售后、费用、日程、公告、知识库、备忘录、个性网址、图表统计、提醒、团队管理等功能模块。</div>
                                    <div class="midtoprr">
                                        <a onmouseover="MM_swapImage('Image90','','images/b01.gif',1)" onmouseout="MM_swapImgRestore()"
                                            href="#">
                                            <img id="Image90" border="0" name="Image90" alt="详细了解项目管理系统" src="images/b1.gif" /></a>
                                        <a onmouseover="MM_swapImage('Image92','','images/b02.gif',1)" onmouseout="MM_swapImgRestore()"
                                            href="#">
                                            <img id="Image92" border="0" name="Image92" alt="视频介绍项目管理系统" src="images/b2.gif" /></a>
                                        <a onmouseover="MM_swapImage('Image93','','images/b04.gif',1)" onmouseout="MM_swapImgRestore()"
                                            href="#">
                                            <img id="Image93" border="0" name="Image93" alt="免费试用项目管理系统" src="images/b03.gif" /></a></div>
                                </div>
                                <div class="midend">
                                    <div class="midtendi">
                                        <span class="STYLE1">管理应用套件:</span>客户关系管理(CRM)、项目管理(PM)、企业资源计划(ERP)、仓库管理(WM)、财务管理(FM)、行政办公(OA)、目标管理(MBO)、电子商务平台(IEBP)、知识及时通(IKM)、人力资源管理(HR)、知识管理(KM)、团队管理(TM)</div>
                                </div>
                            </ul>
                        </div>
                    </div>



--------------------编程问答-------------------- 这个自己慢慢改   一遍一遍的测试 --------------------编程问答-------------------- ie和其他浏览中btn.parentNode.childNodes.length是不同的,firefox含空格,ie不含,所以不行,你需要采用
getElementsByTagName找节点,而不是btn.parentNode.childNodes --------------------编程问答-------------------- --------------------编程问答-------------------- 孟子老大都来了。咱就帮顶吧 --------------------编程问答--------------------
引用楼主 gangchengdu 的回复:
这是js代码

JScript code
//*Tab 懸浮切换
function tabit(btn){
    var idname = new String(btn.id);
    var s = idname.indexOf("_");
    var e = idname.lastIndexOf("_")+1;
    var tabName = idname.substr(0,……

不兼容的话,有什么错误提示吗?
如果考虑兼容性,最好是用jquery来写JS代码,这样你的问题就不是问题了。 --------------------编程问答-------------------- 沒錯誤 就是火狐懸浮上去不顯示下麵到面板了
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,