Im really new in Famo.us and JavaScript. Based on the Timbre Example im trying to implement a GridLayout on the PageView. That works fine. Now i planed to do a click event on every ImageSurface. But that doesnt work like that. Here's my code:
for(var i = 0; i < this.options.imageData.length; i++) {
this.imageSurfaces.push(new ImageSurface({
content: this.options.imageData[i].imgUrl,
size: [200, 200],
properties: {
// backgroundImage: this.options.imageData[i].imgUrl,
color: "black",
textAlign: 'center'
}
}));
//console.log(i);
this.imageSurfaces[ii].on('click', function (){
console.log("Test Click - " + ii + " - " + i);
console.log(this.imageSurfaces[ii]);
}.bind(this));