2026 年 11 月
日一二三四五六123456789101112131415161718192021222324252627282930
当天有发布文章
访客信息
您的 IP 216.73.217.88
浏览器 未知浏览器
您的设备 桌面设备
连接类型 HTTPS · GET
服务语言 未知
当前域名 blog.xoyo.org
站点统计
367文章数目
197评论数目
723累计访问
7312运行天数
封面 加载中…

实现背景音乐多首随机播放的代码

逍遥花主 1 阅读 『搜刮COOL东东』

下午下班回来就继续昨晚未完的工作,没有再用昨天的嵌入式的了,现在用BLOG本身带的模块功能,新建了个模块,加入我写的代码!调试了一下,效果不错,也没有出昨天的状况了,高兴ING![emot]grin[/emot]把写的代码发上来,以备有需要的人用哈,口号是:好东西,大家分享!

代码:

`
<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('<embed src='+'"'+x+'"'+'hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')

else

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

暂无评论

发表评论