日期:2014-05-16 浏览次数:20472 次
function Plugin( element, options ) {
this.options = $.extend( {}, defaults, options );
this.element = $(element);
this._defaults = defaults;
this._name = pluginName;
// this.tagType = ':checkbox', ':radio','select';
this.stackiSelect = $();
this.stackiCheckbox = $();
this.stackiRadio = $();
this.init();
}
Plugin.prototype = {
init: function() {
var fm = this;
this.identify(this.element,'select',this.stackiSelect);
console.log(this.stackiSelect);//undefined ??
this.stackiSelect.each(function(index, domEle) {
//.........
});
},
/*identify the tagType ,and take the tag for transform to the stack */
identify: function(object,tagType,stack) {
object.each(function() {
var self = $(this);
stack = self.is(tagType) ? stack.add(self) : stack.add(self.find(tagType));//identify
});
}
}