Closed lawlesscreation closed 11 years ago
You've to assign the this
-keyword outside of your each
-method:
var self = this;
$(this.element).each(function() {
console.log('Main function');
self.functionOne(self.element, self.options);
});
And btw, you don't need to pass this.element
and this.options
to all your methods. They are already declared in your global scope.
Brilliant, I thought I was going mad. Thanks!
Hi, could someone explain where I am going wrong. I'm trying to use the jQuery boilerplate but having trouble when adding functions and calling them:
This simple calling of functions results in the following console log:
Did I miss something? Reading the comments in the script, I think I'm calling the functions correctly?
Thanks!