The tab feature on MSN Firefox is a bug_ navigation menu for childnodes processing

Source: Internet
Author: User
A bug that Firefox handles to ChildNodes
Childnodesfirefox No filter wrapping and spaces in the processing childnodes. So in the initial use, the results are not expected effect.
Html
Copy Code code as follows:

<ul class= "tbtn" id= "Menulist" >
<li class= "Curr" id= "Tabap3_btn_0" onclick= "Tabit" (This) "> Finance University b</li>
<li id= "tabap3_btn_1" onclick= "Tabit (This)" > Famous Doctors ' Forum </li>
<li id= "tabap3_btn_2" onclick= "Tabit (This)" > Famous Doctors ' Forum </li>
<li id= "Tabap3_btn_3" onclick= "Tabit (This)" > Famous Doctors ' Forum </li>
<li class= "LST" id= "Tabap3_btn_4" onclick= "Tabit" (This) "> Movie hotspot </li>
</ul>

Js
Copy Code code as follows:

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; Different values for IE and FF
for (i=0;i<tabnumber;i++)
{
if (document.getElementById (tabname+ "_div_" +i)!=null)//here needs to be judged
{
document.getElementById (tabname+ "_div_" +i). Style.display = "None";
document.getElementById (tabname+ "_btn_" +i). Style.backgroundimage = "url (pic/t-1-2.gif)";
document.getElementById (tabname+ "_btn_" +i). Style.borderbottomcolor = "#D7F2DA";
document.getElementById (tabname+ "_btn_" +i). Style.cursor = "pointer";
}
}
document.getElementById (tabname+ "_div_" +id). Style.display = "block";
Btn.style.backgroundColor = "#fff";
Btn.style.borderBottomColor = "#fff";
Btn.style.cursor = "Default";
}

On IE, the value of the Menulist Childnodes.length is 5, while the Firefox value is 11. So we need to judge or remove the space when we use the ChildNodes object.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.