+ -
当前位置:首页 → 问答吧 → jquery 插件问题

jquery 插件问题

时间:2009-04-17

来源:互联网

(function($){

function test(){
this.id = "now";
}

test.prototype = {
init: function(){
alert(this.id + " time.");
},
add: function(){
this.init();
}
}

$.fn.extend({
showid: function(opt){
var ss = new test();
$(this).bind("click", ss.add); //1  不能运行
//$(this).click(function(){ss.add();}); //2  可以运行
}
});
})(jQuery)

为什么1不能运行,2却能呢 而且都没有 this.id 这个值

作者: dontlie   发布时间: 2009-04-17

相关阅读 更多