时间:2021-07-01 10:21:17 帮助过:3人阅读
jQuery.fn.extend({
test : function(){
return this.each(function(){
alert(this.nodeName);
})
}
});
调用跟上面一样哦
代码如下:
$('body *').click(function(){
$(this).test().html(this.nodeName).hide(1000);
});
到这里,已经介绍了写jquery插件的两种方法,jquery.extend() 和jquery.fn.extend(),你学会了吗。