我正在创建一个jQuery插件,我无法设置类/方法来适应api访问我想。jQuery插件方法链接类布局
这里是我到目前为止,但它不工作(我得到一个对象不支持此属性或方法错误):
(function($){
$.kitty= function(name) {
this.name = name;
this.cat= function(say) {
alert( this.name + ": " + say);
}
};
})(jQuery);
我想用引起的输出:
$.kitty('chairman meow').cat('meow!');
输出:
chairman meow: meow!
你是对的!我不敢相信我错过了那个;谢谢! – Christopher 2010-09-20 08:43:21