刷新自动换图片的代码
---------------------------------------------------------------------
<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 = "0852580.jpg"
b[1].alt = "PS1"
b[2].src = "0852581.jpg"
b[2].alt = "PS2"
b[3].src = "0852582.jpg"
b[3].alt = "PS3"
b[4].src = "0852583.jpg"
b[4].alt = "PS4"
b[5].src = "0852584.jpg"
b[5].alt = "PS5"
b[6].src = "0852585.jpg"
b[6].alt = "PS6"
b[7].src = "0852586.jpg"
b[7].alt = "PS7"
var pic = "";
pic += '<img src='+b[foot].src+' border="1"'+' alt='+b[foot].alt+'>';
document.write(pic)
</script>
时间: 2024-10-31 23:55:27