随机播放背景音乐的脚本,每一次刷新背景音乐都不同

王朝other·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

<!-- 把如下代码加入<body>区域中 -->

<SCRIPT language="JavaScript">

<!--

var sound1="/js/song1.mid"

var sound2="/js/song2.mid"

var sound3="/js/song3.mid"

var sound4="/js/song4.mid"

var sound5="/js/song5.mid"

var sound6="/js/song6.mid"

var sound7="/js/song7.mid"

var sound8="/js/song8.mid"

var sound9="/js/song9.mid"

var sound10="/js/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>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航