This is a follow up question to my previous one: I have this object:
var myObject {
init: function(){
for (var i = 0; i <3; i++) {
image = new Image();
.
.
.
image.onmouseover = this.Fade(this, 70, 100,1);
image.onmouseout = this.Fade(this, 100, 70,0);
}
},
SetOpacity: function (eID, opacity){
eID.style.opacity = opacity / 100;
eID.style.filter = 'alpha(opacity=' + opacity + ')';
} ,
fade: function (eID, startOpacity, endOpacity){
var timer = 0;
if (startOpacity < endOpacity) {
for (var i = startOpacity; i <= endOpacity; i++) {
(function(opacity) {
setTimeout(function() {SetOpacity(eID, opacity);}, timer * 30);
})(i);
timer++;
}
}
}
}
Do I need to define closures on the events?