I translate some Mootools script to jQuery, and I have function:
play:function( delay, direction, wait )
{
this.isRun = this[direction].periodical(delay,this,true);
}
Header of one from functions which are substituted by this[direction] is:
next:function(manual , item)
Only I found is: use setInterval, but how I can pass parameters to the call?
Things such as:
setInterval(direction + '(' + delay + ', this)')
Very hard for debugging and not beautiful…
Is here more beautiful way, maybe using other methods?
Looks like you need an anonymous function. Try something like this: