i’m using the jquery boilerplate () and am having trouble accessing my options thru my differents methods.
For example
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'
}
}
I’m trying to have access to my options in my enter method but without success.
Can someone help me figured out why?
Thanks
thisin the handler is the element you clicked on.If you want to preserve your original
this, call jQuery.proxy.