第三行的as[i].num=i是什么意思啊,是var i=as[i].num吗?用.index不行吗
for(var i=0; i<as.length; i++){
as[i].num = i
as[i].onmouseover = function(){
this.style.background = '#ccc'
index = as[i].num-1;
}
as[i].onmouseout = function(){
this.style.background = '#fff'
}
as[i].onclick = function(event){
event = event||window.event;
if(event.stopPropagation){
event.stopPropagation();
}else{
event.cancelBubble = true;
}
menu.style.display = 'none';
title.innerHTML = this.innerHTML;
}
}