以PageSwitch为例 var PageSwitch=(function(){ function PageSwitch(ele,options){ } PageSwitch.prototype={ init:function(){ }, PagesCount:function(){ } } return PageSwitch;})();$.fn.PageSwitch=function(options){ return this.each(function(){
var PageSwitch=(function(){
function PageSwitch(ele,options){
}
PageSwitch.prototype={
init:function(){
},
PagesCount:function(){
}
}
return PageSwitch;
})();
$.fn.PageSwitch=function(options){
return this.each(function(){
var self = this;
var instance = self.data('PageSwitch');
if(!instance){
instance = new PageSwitch(self,options);
self.data('PageSwitch',instance);
}
if($.type(options) === 'string'){
return instance[options]();
}
});
}
$.fn.PageSwitch.defaults={
}
