• 基于jQuery仿uploadify的HTML5图片上传控件jquery.html5uploader


    (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)

  • 相关阅读:
    PKI的签密体制学习(含信息安全基础)
    Linux软件安装
    Linux基础
    JSP EL表达式入门1
    Tomcat 错误: 代理抛出异常错误: java.rmi.server.ExportException: Port already in use: 1099 解决方法
    JSP JSTL入门
    JSP组件
    JSP动作
    实现序列化的java类中的serialVersionUID的作用
    [Noip2016]蚯蚓
  • 原文地址:https://www.cnblogs.com/rubekid/p/4281118.html
Copyright © 2020-2023  润新知