您的位置:首页 > 其它

jdownload的使用

2015-09-11 11:33 351 查看
<!DOCTYPE html>

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

<head>

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

<title></title>

<link href="js/themes/base/jquery.ui.all.css" rel="stylesheet" />

<link href="js/jquery.jdownload.css" rel="stylesheet" />

</head>

<body>

<a title="title" id="download">点击预览下载</a>

<script src="js/jquery-1.9.1.js"></script>

<script src="js/ui/jquery-ui.js"></script>

<script src="js/jquery.jdownload.js"></script>

<script>

$(document).ready(function () {

$('#download').jDownload({

event: 'click',

dialogWidth: 200,

dialogHeight: 200,

filePath: "/file/test.zip"

});

});

</script>

</body>

</html

引用jquery和ui库,引用jquery.jdownload.js和样式。

参数说明

var config = {

root: "http://localhost:8080/",//你网站的地址。

filePath : null,

event : "click", // 默认是支持点击事件

dialogTitle : "文件下载",

dialogDesc : '点击下载',

dialogWidth : 200,

dialogHeight : 'auto',

dialogModal : true,

showfileInfo : true,

start : null,

stop : null,

download : null,

cancel : null

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