Hi
I have a loop looping through an "band" object array. I am assigning a anonymous functions for the object property(actually dragging)
for (var j=0;j<5;j++)
{
var othis = this.bands[j];
othis.onDragstart = (function() {return othis.onDragstartResizeHandle()});
}
onDragstartResizeHandle function
band.prototype.onDragstartResizeHandle = function()
{
alert(this.id);
}
when I drag a band it always alert the id of 5th band. not the id of that band which i am currently refering. (even this is a anonymous function)
Cansomeone please tell me why?