Defining a recursive function in a Prototype class?

Posted by btl on Stack Overflow See other posts from Stack Overflow or by btl
Published on 2010-04-19T15:28:03Z Indexed on 2010/04/19 15:33 UTC
Read the original article Hit count: 260

Filed under:
|

I'm trying to create an image rotator class that cycles through an arbitrary number of images in an unordered list. Is it possible to define a recursive function within a class declaration? E.g:

var Rotator = Class.create() {
 initialize: function() {
  do something...

  this.rotate();
 }

 rotate: function() {
   do something...

   this.rotate()
 }
}

© Stack Overflow or respective owner

Related posts about prototype

Related posts about JavaScript