从而可以展示或掩盖:
$(selector).pluginName( show )
$(selector).pluginName( hide )
问题在于我是如何知道什么是来显示或隐藏?
我现在这样做:
$.fn.pluginName = function(opts) {
var conf = $.extend({},opts);
return this.each(function() {
if(conf && conf == conf.type)
{
//ClassName is defined elsewhere
new ClassName(conf,$(this));
}
else
{
//**show or hide corresponding instance**
}
});
}