Off the top of my head (untested, sorry)
var things = $('things');
var index = 0;
things.eq(0).doStuff();
var fn = function() {
index++;
things.eq(index).doStuff();
setTimeout(fn,1000);
};
setTimeout(fn,1000);
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of d.williams
Sent: Wednesday, November 19, 2008 5:05 PM
To: [email protected]
Subject: [jQuery] Pause between each()
Hi, all. I was wondering how I insert a pause between moving to the
next item in an each function.
Pseudo-code:
$('things').each(function() {
\\ do suff
sleep(5000);
});
I know I need to use setTimeout, but I'm not sure how to pass
setTimeout an iterator so the next item is passed.
Any ideas?
Thanks,
Danny