var lbt=document.getElementById("lbt-div");
var ul=document.getElementById("lbt-img");
var img=ul.getElementsByTagName("li");
var ol=document.getElementById("lbt-ol").getElementsByTagName("li");
var index=0;
var timer=null;
timer=setInterval(lb,2000);
function lb(){
index++;
if(index>=ol.length){
index=0;
}
for(k=0;k<img.length;k++){
img[k].style.display="none";
ol[k].className=""
}
img[index].style.display="block";
ol[index].className="ol";
}
lbt.onmouseover=function(){
clearInterval(timer)
};
lbt.onmouseout=function(){
setInterval(lb,2000)
};
for(var i=0;i<img.length;i++){
ol[i].id=i;
ol[i].onmouseover=function(){
for(var j=0;j<img.length;j++){
img[j].style.display="none";
ol[j].className="";
}
img[this.id].style.display="block";
ol[this.id].className="ol";
}
}
添加回答
举报
0/150
提交
取消