<Div id="Music_div"></DIV>
function chgMusic(src) {
if (src) {
documnet.all.Music_div.innerHTML ="<embed src='"+src+"'></embed>";
} else { }}
function chgMusic(src) {
if (src) {
documnet.all.Music_div.innerHTML ="<embed src='"+src+"'></embed>";
} else { }}
解决方案 »
- jquery 验证插件 在asp.net的母版页下用不了 求助
- 怎么实现iframe全局刷新
- 英文5到15个字母的名字的正则表达式?
- 如何给onclick 加入判断条件
- 如何查找字符串里里面的反斜杠
- 如何让我做的光盘版的网页,在其他人本地浏览时,不出现安全警告?
- 如何在网页中实现对我自动生成的DM单进行打印!!!高分寻求!!!
- 一个严重的问题, onsubmit 都返回true了。 但是表单还是没有提交 ie8,ie6 都是
- 在javascript中,是不是不能用数字作id
- Javascript能不能实现"下载文件到指定的目录",或安装"某程序"?谢谢!
- 看看这个按钮怎么无法执行location.href语句呢?
- <a href='#' onClick=window.open,为什么一点到这个连接网页总会条到顶部?
<title>Control Music</title>
<bgsound id=bs>
</head><body topmargin="20" leftmargin="20">
<script language=javascript>
function setmusic(bs){
this.bs=bs;
this.musiclist=new Array(
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10"
);
this.at=0;
this.play=function(){
this.bs.src="./mp3/"+this.musiclist[this.at]+".mp3";
this.bs.loop=-1;
}
this.back=function(){
this.at-=1;
if(this.at<0)
this.at=this.musiclist.length-1;
this.play();
}
this.front=function(){
this.at+=1;
if(this.at>this.musiclist.length-1)
this.at=0;
this.play();
}
this.stop=function(){
this.bs.src="";
this.bs.loop=0;
}
}
var music=new setmusic(document.all.bs);
</script>
<br><br>
<TABLE WIDTH=47 BORDER=0 CELLPADDING=0 CELLSPACING=0 >
<TR>
<TD>
<A HREF="javascript:music.back();">
<IMG SRC="images/back.jpg" WIDTH=11 HEIGHT=11 BORDER=0 ALT="前一首"></A></TD>
<TD>
<A HREF="javascript:music.play();">
<IMG SRC="images/go.jpg" WIDTH=12 HEIGHT=11 BORDER=0 ALT="播放"></A></TD>
<TD>
<A HREF="javascript:music.stop();">
<IMG SRC="images/stop.jpg" WIDTH=12 HEIGHT=11 BORDER=0 ALT="停止"></A></TD>
<TD>
<A HREF="javascript:music.front();">
<IMG SRC="images/front.jpg" WIDTH=12 HEIGHT=11 BORDER=0 ALT="后一首"></A></TD>
</TR>
</TABLE>
</body>
</html>
2 在用随机出来的数字匹配背景音乐名
<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=sound1else if (x==1) x=sound2else if (x==2) x=sound3else if (x==3) x=sound4else if (x==4) x=sound5else if (x==5) x=sound6else if (x==6) x=sound7else if (x==7) x=sound8else if (x==8) x=sound9else x=sound10if (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">')
//-->
</SCRIPT>