您的位置:首页 > Web前端 > JQuery

jmp3是一款jquery开源插件,该插件可以播放音乐文件。

2013-09-06 14:58 696 查看
jmp3是一款jquery开源插件,该插件可以播放音乐文件。

使用该插件的方法:

1.下载jquery.js,该插件是在jquery基础上使用的。

2.下载jquery.jmp3.js,该js文件是核心。

3.下载singlemp3player.swf,没有该文件,该插件将无法使用。

4.选择一个你喜欢的音乐文件命名为music.mp3,并将它和上面的三个文件放在同一个目录下。

5.打开jquery.jmp3.js,找到playerpath并修改它的值为:playerpath = "./"。

6.编辑html代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>jmp3</title>

</head>

<script type="text/javascript" src="./jquery-1.7.2.js" ></script>

<script type="text/javascript" src="./jquery.jmp3.js" ></script>

<script language="javascript">

$(document).ready(function(){

$("#sound").jmp3({

showfilename: "false",

backcolor: "FFFBF0",

forecolor: "00ff00",

width: 400,

showdownload: "false"

});;

}

)

</script>

<style>

.mp3 { color: firebrick; font-family: Georgia, "Times New Roman", Times, serif; font-size: 0.9em; }

</style>

<body>

<div>在下面的span标签内容里填写你的音乐文件路径</div>

<span id="sound" class="mp3">music.mp3</span>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: