Google
      
发新话题
打印

[代码] 加入音乐代码

加入音乐代码

放入友联的说明里
1.为无限次循环


<bgsound src="音乐地址" loop="-1">



2.随即播放背景音乐


这个效果可以让没次进主页所播放的音乐会不同.

<SCRIPT language="javascript">
<!--
var sound1="音乐的地址1"
var sound2="音乐的地址2"
var sound3="音乐的地址3"
var sound4="音乐的地址4"
var sound5="音乐的地址5"
var sound6="音乐的地址6"
var sound7="音乐的地址7"
var sound8="音乐的地址8"
var sound9="音乐的地址9"
var sound10="音乐的地址10"
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">')


//-->


TOP

这个不错,可是代码也太长了。

TOP

额。。

代码要放到那里捏???

瓦不懂。。

瓦粉笨滴。

TOP

发新话题