That's great, I'm glad it worked!
Just a minor point of terminology: There's actually no recursion in that
code, although it does have a recursive "feel" to it. The callback functions
are called at a later time after the original function has returned.
Recursion would be when you have a function
Thanks Michael
Your code worked right off the copy and paste. I knew there was a
recursive procedure in there somewhere, but I'm just getting up to speed
with Javascript after years of ignoring it due to the pain and suffering
involved in writing cross platform stuff. Jquery has made me want
Just to explain that code a bit... You can't use a simple for loop, because
your repeated steps have to be run asynchronously, when the fadeOut callback
function is called.
So, instead of using a separate callback function for each step, this code
uses a common callback for all the steps, and mak
I think you could do it something like this (untested):
$.fn.walk = function( now, incr, last ) {
var $it = this;
step();
function step() {
$it.css({ backgroundPosition: now + ' 0' }).show();
now += incr;
if( now != last ) $it.fadeOu
4 matches
Mail list logo