【发布时间】:2013-12-29 08:35:06
【问题描述】:
是否可以从事件处理程序中调用类方法? 我的意思是,像这样:
initialize: function(options) {
/* initial options */
this.setOptions(options);
this.area = (this.options.status == 'out') ? $(this.options.loggedoutArea) : $(this.options.loggedinArea);
this.button = $(this.options.buttonArea);
this.button.addEvent('click', function(){
this.showHideBanner();
});
},
showHideBanner: function() {
this.area.setStyle('display', 'none');
},
在此处查看完整示例http://jsfiddle.net/dvzj6/
【问题讨论】:
标签: class events scope mootools