jquery 插件 起动代码

jquery 插件 起步代码
/**
 * Created by W.J.Chang on 2014/6/25.
 */

;(function($) {
    var methods= {
        check: function() {
            return this.each(function() { this.checked = true; });
        }
    };

    $.fn.pager = function(method) {
        if ( methods[method] ) {
            return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
        } else if ( typeof method === 'object' || ! method ) {
            return methods.check.apply( this, arguments );
        } else {
            $.error( 'Method ' +  method + ' does not exist on jQuery.tooltip' );
        }
    };
})(jQuery);