If a jQuery function calls itself in its completion callback, is that a recursive danger to the stac

Posted by NXT on Stack Overflow See other posts from Stack Overflow or by NXT
Published on 2010-04-24T17:02:17Z Indexed on 2010/04/24 17:13 UTC
Read the original article Hit count: 242

Filed under:
|
|

Hi,

I'm writing a little jQuery component that animates in response to button presses and also should go automatically as well. I was just wondering if this function recursive or not, I can't quite work it out.

function animate_next_internal() {

  $('#sc_thumbnails').animate(
    { top: '-=106' }, 
    500, 
    function() {
      animate_next_internal();
    }
  ); 
}  

My actual function is more complicated to allow for stops and starts, this is just a simplified example.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about recursion