1,
function ntabs(thisObj,Num)
{if(thisObj.className == "active")return;
var tabObj = thisObj.parentNode.id;
var tabList = document.getElementById(tabObj).getElementsByTagName("li");
for(i=0; i <tabList.length; i++)
{if (i == Num)
{thisObj.className = "active";
document.getElementById(tabObj+"_cont"+i).style.display = "block";
}
else{
tabList[i].className = "normal";
document.getElementById(tabObj+"_cont"+i).style.display = "none";
}
}
}
2,
$(document).ready(function(){
var $tab_li = $(‘.tab ul li‘);
$tab_li.hover(function(){
$(this).addClass(‘selected‘).siblings().removeClass(‘selected‘);
var index = $tab_li.index(this);
$(‘div.tab_box > div‘).eq(index).show().siblings().hide();
});
});
tab切换的两段js