以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 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={
}
如果您觉得本文的内容对您的学习有所帮助:
关键字:
jQuery