CSDN博客

img SStallMan

随机播放音乐的代码

发表于2004/10/26 18:03:00  2258人阅读

分类: <font size=4 color=gray>杂七杂八</font>

下面是随机播放音乐的代码

<script>

var nummidi = 7
day = new Date()
seed = day.getTime()
ran = parseInt(((seed - (parseInt(seed/1000,10) * 1000))/10)/100*nummidi + 1,10)
if (ran == (1)) midi=("http://ftp.cumt.edu.cn/cumtonline/music/music4/banderui/Windmills.mp3")
if (ran == (2)) midi=("http://ftp.cumt.edu.cn/cumtonline/music/music4/banderui/Diamonds.mp3")
if (ran == (3)) midi=("http://ftp.cumt.edu.cn/cumtonline/music/music4/banderui/Spring%2DWater.mp3")
if (ran == (4)) midi=("http://ftp.cumt.edu.cn/cumtonline/music/music4/banderui/Melody%2DOf%2DHope.mp3")
if (ran == (5)) midi=("http://ftp.cumt.edu.cn/cumtonline/music/music4/banderui/Moutain-Stream.mp3")
if (ran == (6)) midi=("http://ftp.cumt.edu.cn/cumtonline/music/music3/beyond/%C7%E9%C8%CB.mp3")
if (ran == (7)) midi=("http://ftp.cumt.edu.cn/cumtonline/music/music3/beyond/%BA%A3%E9%9F%CC%EC%BF%D5.mp3")
document.write('<bgsound SRC= "' + midi + '" volume=100 controls=smallconsole loop=-1 HSPACE=3 WIDTH=48 HEIGHT=26 AUTOSTART=TRUE>')
// -->
</script><br>

阅读全文
0 0

相关文章推荐

img
取 消
img