hujingjian 发表于 2007-4-27 11:37:46

***综合类***背景音乐实现随机播放

把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件
要完成此效果把如下代码加入到<body>区域中

<script language="javascript">

<!--

var sound1="song1.mid"

var sound2="song2.mid"

var sound3="song3.mid"

var sound4="song4.mid"

var sound5="song5.mid"

var sound6="song6.mid"

var sound7="song7.mid"

var sound8="song8.mid"

var sound9="song9.mid"

var sound10="song10.mid"

var x=math.round(math.random()*9)

if (x==0) x=sound1

else if (x==1) x=sound2

else if (x==2) x=sound3

else if (x==3) x=sound4

else if (x==4) x=sound5

else if (x==5) x=sound6

else if (x==6) x=sound7

else if (x==7) x=sound8

else if (x==8) x=sound9

else x=sound10


if (navigator.appname=="microsoft internet explorer")

document.write('<bgsound src='+'"'+x+'"'+' loop="infinite">')

else

document.write('<embed src='+'"'+x+'"'+'hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')





//-->





</script>

      










--------------------------------------

拥有三人行论坛管理系列软件,一个人就可以管理一个论坛的更新维护。还能使您的论坛有千人在线的真实火暴效果,让您不在为论坛因没有人气而留不住会员而烦恼,使您的论坛早日成为一流的论坛。详情请登陆网站:http://www.cnsrx.cn 三人行论坛管理软件,站长必备的专业好工具。(您使用的是免费版本,购买收费版本后,将不带广告。业务QQ:247216 44985227)
页: [1]
查看完整版本: ***综合类***背景音乐实现随机播放