■ <BGSOUND> 是用以插入背景音乐,但只适用於 IE,其参数设定不多。
<BGSOUND src="liberation.mp3"; autostart=true loop=infinite>

src="your.mid"
设定 midi 或者是 mp3 档案及路径,可以是相对或绝对。
autostart=true
是否在音乐档传完之後,就自动播放音乐。true 是,false 否 (内定值)。
loop=infinite
是否自动反覆播放。LOOP=2 表示重复两次,Infinite 表示重复多次。

■ <embed>:

  <embed> 是用来插入各种多媒体,格式可以是 midi、wav、aiff、au 等等,netscape 及 新版的 ie 都支持。其参数设定较多。如下下

  <embed src="your.mid" autostart="true" loop="true" hidden="true">

src="your.mid"
设定 midi 档案及路径,可以是相对或绝对。
autostart=true
是否在音乐档下载完之后就自动播放。true 是,false 否 (内定值)。
loop="true"
是否自动反复播放。loop=2 表示重复两次,true 是, false 否。
hidden="true"
是否完全隐藏控制画面,true 为是,no 为否 (内定)。
starttime="分:秒"
设定歌曲开始播放的时间。如 starttime="00:30" 表示从第30秒处开始播放。
volume="0-100"
设定音量的大小,数值是0到100之间。内定则为使用系统本身的设定。
width="整数" 和 high="整数"
设定控制面板的高度和宽度。(若 hidden="no")
align="center"
设定控制面板和旁边文字的对齐方式,其值可以是 top、bottom、center、baseline、 left、right、texttop、middle、absmiddle、absbottom
controls="smallconsole"
设定控制面板的外观。预设值是 console。
console 一般正常面板   
smallconsole 较小的面板   
playbutton 只显示播放按钮   
pausecutton 只显示暂停按钮   
stopbutton 只显示停止按钮   
volumelever 只显示音量调节按钮

实例:

1. <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
   2. <html xmlns="http://www.w3.org/1999/xhtml">
   3. <head>
   4. <meta http-equiv="content-type" content="text/html; charset=gb2312" />
   5. <title>无标题文档</title>
   6. </head>
   7.
   8. <body>
   9. <bgsound src="http://sj.cpgl.net/sjbbs/midi/md01.mid " autostart=true loop=infinite>
  10. </body>
  11. </html>

复制代码

1. <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
   2. <html xmlns="http://www.w3.org/1999/xhtml">
   3. <head>
   4. <meta http-equiv="content-type" content="text/html; charset=gb2312" />
   5. <title>无标题文档</title>
   6. </head>
   7.
   8. <body>
   9. <embed src="http://www.bricklin.cn/zly/theone/2.wma" width="0" height="0"></embed>
  10. </body>
  11. </html>

当bgsound出现在iframe框架页面内时,如果框架页面内的背景音乐正在加载或正在播放

  当移除这个iframe框架时,该背景音乐仍然继续播放,而且窗口最小化后仍然播放

  直到音乐自然播放完毕或窗口关闭时停止(不会循环播放)。

  无论bgsound标签的loop属性设置如何,音乐只会播放一次。

  演示代码如下:

  <iframe id=bgmusic width=30 height=20></iframe>

  <script language=javascript>

  function window.onload(){

  var bghtml='sound<bgsound src="http://clearsky.gougou.cc/xiaonei/music.asp" loop="-1">';

  bgmusic.document.body.innerHTML=bghtml;

  document.all.bgmusic.removeNode();

  }

  </script>

最新文章

  1. android Viewpager HorizontalScrollView 实现分页栏拖拽
  2. 此数据库文件与当前sql server实例不兼容
  3. E-Form++图形可视化源码库新增同BCGSoft的Ribbon结合示例
  4. 功能齐全并且比较时髦的Jquery通用开源框架之【ejq.js】
  5. Bootstrap Table表格一直加载(load)不了数据-解决办法
  6. Java读取Properties配置文件
  7. NPOI_2.1.3-Excel中设置小数、百分比、货币、日期、科学计数法和金额大写
  8. nginx 一般配置实例 静态页面
  9. css备忘录(关于relative、absolute)
  10. perl 分析binlog 定位错误sql 思路
  11. STL中主要的算法(一)
  12. chd校内选拔赛题目+题解
  13. Hibernate与IBatis的优缺点及可行性分析
  14. 路由-when-resolve
  15. Qt个人研究进展
  16. mac os下vscode快捷键
  17. JSON.stringify()和JSON.parse()的作用
  18. 大连CCPC D - A Simple Math Problem
  19. [转] Python Traceback详解
  20. Python open详解

热门文章

  1. Web Server 使用WebClient 发送https请求 The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel
  2. Android 手机配office365邮箱
  3. TestNG超详细教程
  4. Linux操作系统基础(四)保护模式内存管理(2)【转】
  5. Linux内核的整体架构
  6. android 分区layout以及虚拟内存布局-小结
  7. hdu4430Yukari&#39;s Birthday(二分)
  8. DELPHI 里面的迭代
  9. UVa 1611 (排序 模拟) Crane
  10. makefile learning