html5中文学习网

您的位置: 首页 > 网站及特效实例 > javascript特效 » 正文

背景音乐每次刷新都可以自动更换_典型特效_

[ ] 已经帮助:人解决问题
<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

(责任编辑:)
推荐书籍
推荐资讯
关于HTML5先行者 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助