首页 > 技术文章 > jQuery 插件开发

yeyuansheng 2017-08-19 01:04 原文

 

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

 

推荐阅读