1月10
         今天又一朋友让帮忙解决他的页面中的背景音乐的问题,如果用bgsound只有ie支持,其它firefox,chrome浏览器都不支持。这里给出了具体的解决方法。
打开一个空白控制面板粘贴下面代码,到网上搜索你要的歌曲,把地址复制过来保存
<embed src=音乐链接地址 width=200 height=50 type=audio/mpeg loop="true" autostart="true">
width和height为播放器宽度和高度,可以灵活设置。
autostart="true"为自动播放,autostart="false"为不自动播放.
loop="true"为连续循环播放,loop="false"为不循环播放.
loop可以等于一个整数,比如loop="3",就是音乐循环播放3次

firefox如果不能播放,会提示安装quicktime ,经过测试(IE6+ firefox chrome测试通过)

以下是补充方法:推荐用第一种方法:

<embed src="bgsound.mp3" height="45" width="250">

其中src 后跟要插入的音乐文件的名称,height和width是播放框的高度和宽度。

如果希望在网页打开后自动播放音乐,可使用如下代码:

<DIV align=center><embed src="bgsound.mp3" height="45" width="250" autostart="true" ></DIV>

如果希望播放框居中显示,可使用如下代码:

<DIV align=center><embed src="bgsound.mp3" height="45" width="250"></DIV>

要让你的网页能够在Firefox浏览器中播放背景音乐,使用object标签。
分页: 1/1 第一页 1 最后页 [ 显示模式: 摘要 | 列表 ]