背景音乐每次刷新都可以自动更换

时间:2007-02-01    点击:113   
<SCRIPT LANGUAGE="javascript"> 
<!-- 
var sound1="http://歌曲地址"   
var sound2="http://歌曲地址"   
var sound3="http://歌曲地址"   
var sound4="http://歌曲地址"   
var sound5="http://歌曲地址"   
var sound6="http://歌曲地址"   
var sound7="http://歌曲地址"   
var sound8="http://歌曲地址"   
var sound9="http://歌曲地址"   
var sound10="http://歌曲地址"   
var x=Math.round(Math.random()*10) 
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" autostart="true" loop="true">') 
//--> 
</SCRIPT>


Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=348256

JavaScript脚本性能的优化方法
JavaScript中“+=”的应用
HTTP状态代码以及定义(解释)
任意位置显示html菜单
Javascript 判断 object 的特定类转载
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved