代码如下
var nnn;
nnn=1;imgchange();
function imgchange()
{
if(nnn==1)
{ document.getElementById('focuspic1').style.display="block";
document.getElementById('focuspic2').style.display="none";
document.getElementById('focuspic3').style.display="none";
document.getElementById('focusnum1').style.color="yellow";
document.getElementById('focusnum2').style.color="black";
document.getElementById('focusnum3').style.color="black";
setTimeout('imgchange()',1000);
}
if(nnn==2)
{ document.getElementById('focuspic1').style.display="none";
document.getElementById('focuspic2').style.display="block";
document.getElementById('focuspic3').style.display="none";
document.getElementById('focusnum1').style.color="black";
document.getElementById('focusnum2').style.color="yellow";
document.getElementById('focusnum3').style.color="black";
setTimeout('imgchange()',1000);
}
if(nnn==3)
{ document.getElementById('focuspic1').style.display="none";
document.getElementById('focuspic2').style.display="none";
document.getElementById('focuspic3').style.display="block";
document.getElementById('focusnum1').style.color="black";
document.getElementById('focusnum2').style.color="black";
document.getElementById('focusnum3').style.color="yellow";
setTimeout('imgchange()',1000);
}
nnn++;
if(nnn==4)
{
nnn=1;
}
}