jQuery 插件开发

 

(function($) {
    var plugin_name = 'tab';
    var plugin = function(ele,opt){
        this.element = ele,
        this.defaults = {
            panel:'',
            content:''
        };
        this.options = $.extend(true,{}, this.defaults, opt);
        this.read();
    }
    plugin.prototype ={
        read:function(){
        }
    }
    $.fn[plugin_name] = function(options){
        var obj = new plugin(this,options);
        return obj.read;
    }
})(jQuery);

 

posted @ 2017-08-19 01:04  夜愿生  阅读(110)  评论(0)    收藏  举报