对于this和index的运用
window.onload=function(){
var oul1=document.getElementById("ul1");
var oli=oul1.getElementsByTagName("li")
var odiv=document.getElementById("tab-list");
var adiv=odiv.getElementsByTagName("div");
for(var i = 0;i<oli.length;i++){
oli[i].index=i;
oli[i].onmouseover = function(){
for(var n = 0;n<oli.length;n++){
oli[n].className="";
adiv[n].className="hide";
}
this.className="active";
adiv[this.index].className="show";
}
}
}
上面的this.className,adiv[this.index]。index的用法