刷新自动换图片的代码
---------------------------------------------------------------------<script language="JavaScript">
a = 7 //最大随机数(图片总数)
var pp = Math.random();
var foot = Math.round(pp * (a-1))+1;
function create() {
this.src = ''
this.alt = ''
}
b = new Array()
for(var i=1; i<=a; i++) { b[i] = new create() }
b[1].src = "http://www.itblo.com/uploads/allimg/080224/0852580.jpg"
b[1].alt = "PS1"
b[2].src = "http://www.itblo.com/uploads/allimg/080224/0852581.jpg"
b[2].alt = "PS2"
b[3].src = "http://www.itblo.com/uploads/allimg/080224/0852582.jpg"
b[3].alt = "PS3"
b[4].src = "http://www.itblo.com/uploads/allimg/080224/0852583.jpg"
b[4].alt = "PS4"
b[5].src = "http://www.itblo.com/uploads/allimg/080224/0852584.jpg"
b[5].alt = "PS5"
b[6].src = "http://www.itblo.com/uploads/allimg/080224/0852585.jpg"
b[6].alt = "PS6"
b[7].src = "http://www.itblo.com/uploads/allimg/080224/0852586.jpg"
b[7].alt = "PS7"
var pic = "";
pic += '<img src='+b[foot].src+' border="1"'+' alt='+b[foot].alt+'>';
document.write(pic)
</script>
刷新网页时自动变换图片效果
80酷酷网 80kuku.com