楼主试试这个看看
<img id="images" >
<script>
function getImg()
{
document.all.images.src = "img/"+parseInt(Math.random()*(5))+".gif";
if(document.all.images.clientWidth>150 && document.all.images.clientHeight>100)
document.all.images.src = "img/'+parseInt(Math.random()*(5))+'.gif";
}
setInterval("getImg()",3000);
</script>
<img id="images" >
<script>
function getImg()
{
document.all.images.src = "img/"+parseInt(Math.random()*(5))+".gif";
if(document.all.images.clientWidth>150 && document.all.images.clientHeight>100)
document.all.images.src = "img/'+parseInt(Math.random()*(5))+'.gif";
}
setInterval("getImg()",3000);
</script>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货