JavaScript图片切换兼容问题
<script language="javascript"> var adImg = new Array();
var adLink = new Array();
var cID = 0;
adImg[0] = "1.jpg";
adImg[1] = "2.jpg";
adImg[2] = "3.jpg";
var preImgs = new Array();
for(i=0;i<2;i++) {
preImgs[i] = new Image();
preImgs[i].src = adImg[i];
}
function NextAd()
{
if(cID == 3)cID=0;
if(document.all) {
imgAD.filters.revealTrans.Transition=Math.floor(Math.random()*23);
imgAD.filters.revealTrans.apply();
imgAD.src = adImg[cID];
imgAD.filters.revealTrans.play();
cID++;
setTimeout("NextAd()", 4000);
}
}
</script>
<img name="imgAD" style="FILTER: revealTrans(duration=2,transition=20);BORDER-RIGHT:#cccccc 1px solid; BORDER-TOP:#cccccc 1px solid; BORDER-LEFT:#cccccc 1px solid; BORDER-BOTTOM:#cccccc 1px solid" src="javascript:NextAd()" border="0" width="220" height="160" hspace="0" vspace="0">
以上代码在ie5中运行正常,但在ie8上就显示不出来,请教高手如何解决