I have an event firing and even though it's inside of the function from which I'm trying to access variables, I get Uncaught TypeError: Cannot read property '...' of undefined
. So, let's say:
( function($) {
$.fn.main = function() {
this.setting = 1;
$("#someElement").scroll( function() {
console.debug(this.setting);
} );
}
} )(jQuery);
I'm sure it has something to do with timing, but then again, I could be wrong. Should I make a copy of this
and make that public? Anyone? Thanks.