(function($){
var methods = {
init:function(options){
return this.each(function(){
var $this = $(this);
var $clone = $this.clone();
var settings = $.extend({
id : $this.attr('id'),
button:$this,
uploader : '',
formData:{},
auto : true,
fileTypes : '*.*',
multi : true,
fileSizeLimit: 0,
queueSizeLimit:1,
onUploadStart:function(fileManager){return true;},//上传开始时的动作
onUploadSuccess:function(fileManager, response){},//上传成功的动作
onUploadComplete:function(fileManager){},//上传完成的动作
onUploadError:function(fileManager, response){},//上传失败的动作
onProgress:function(fileManager, loaded, total){},//上传进度
onInit:function(){},//初始化时的动作
//beforeUpload:function(){}, //开始上传前执行
},options); this._uploader = new H5Uploader.Uploader(settings);
});
}
};
$.fn.html5uploader = function(method){
if (methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'object' || !method) {
return methods.init.apply(this, arguments);
} else {
$.error('The method ' + method + ' does not exist in $.html5uploader');
}
};
})(jQuery);

完整脚本 (提取码:7261)

最新文章

  1. CMD:在当前文件夹下打开cmd命令
  2. 用JQ仿造礼德财富网的图片查看器
  3. ZooKeeper官方文档翻译——ZooKeeper Overview 3.4.6
  4. Fragemnt和TextView的交互(TextView在LinearLayout中)
  5. 编写高质量代码改善C#程序的157个建议——导航开篇
  6. 【CSS3】CSS3 滤镜实现
  7. PostgreSQL Replication之第十章 配置Slony(1)
  8. Doing well in your courses ---- a guide by Andrej Karpathy
  9. Unix环境链接静态库
  10. F# 之旅(下)
  11. 变态的IE
  12. 09-Python入门学习-函数基础与参数
  13. 树莓派pwm驱动好盈电调及伺服电机
  14. MapReduce作业的工作原理
  15. 【百度杯】ctf夺旗大战,16万元奖励池等你拿
  16. vue cli 解决跨域 线上 nginx 反向代理配置
  17. [转]data-driven与决策树聚类的两种方法
  18. 关于ASP.NET预编译(转自dudu)
  19. Win10系列:VC++调用自定义组件1
  20. HanLP 配置与使用

热门文章

  1. javascript 键值对
  2. 去掉所有的html标签
  3. select options常用操作
  4. sqlserver 进行MD5加密
  5. WebApi 4.0 默认方式不支持HttpGet 请求
  6. Maven插件开发
  7. Python三元表达式
  8. 机器学习公开课~~~~mooc
  9. CENTOS纯手工安装LAMP+PHPMYADMIN
  10. BZOJ1524: [POI2006]Pal