var that = this; this.intervalID['id' + i] = setInterval(function() { that.animation(i, up, end, step); }, delay);