提示:下面的Banner会随机的变化,共三个Banner随机出现。
1.将下面的代码放到摆放广告的地方
程序代码:
<script language="JavaScript">
a = 3
var slump = Math.random();
var talet = Math.round(slump * (a-1))+1;
function create() {
this.src = ''
this.border = ''
this.alt = ''
}
b = new Array()
for(var i=1; i<=a; i++) { b[i] = new create() }
b[1].src = "../pic/pic01.gif"
b[1].border = "0"
b[1].alt = "图形一"
b[2].src = "../pic/pic02.gif"
b[2].border = "0"
b[2].alt = "图形二"
b[3].src = "../pic/pic03.gif"
b[3].border = "0"
b[3].alt = "图形三"
var visa = "";
visa += '<img src='+b[talet].src+' border="0"'+' alt='+b[talet].alt+'>';
</script>
<script language="JavaScript">
<!-- Hide this script from old browsers --
document.write(visa)
// -->
</script>
2.修改此处为你的Banner路径
b[1].src = "../pic/pic01.gif"
b[1].border = "0"
b[1].alt = "图形一"
b[2].src = "../pic/pic02.gif"
b[2].border = "0"
b[2].alt = "图形二"
b[3].src = "../pic/pic03.gif"
b[3].border = "0"
b[3].alt = "图形三"