【发布时间】:2012-09-19 23:24:42
【问题描述】:
我正在使用 jquery 样板 (),并且无法通过我的不同方法访问我的选项。
例如
Plugin.prototype = {
init: function()
{
console.log(this.options); // This output my options
$(this.element).on('mouseenter', this.enter);
$(this.element).on('mouseleave', this.leave);
$(this.element).on('click', this.click);
},
enter: function(e)
{
console.log(this.options); // This output 'undefined'
}
}
我试图在我的 enter 方法中访问我的选项,但没有成功。
谁能帮我找出原因?
谢谢
【问题讨论】:
标签: jquery methods boilerplate