in a class I've got this: initialize : function(imgs,options){ this.setOptions(options); this.imgs = $$(imgs); // more code },
getDimensions : function(){ // other code this.imgs.each(function(index){ imgWidth[index] = this.imgs[index].getSize().x; // here's the issue }.bind(this)); } Debugging tells me "this.imgs[index].getSize().x is not a function". I'm sure this is a problem with binding, how do I bind this.imgs inside of the each function?