[jQuery] Re: pausing jquery

2008-12-30 Thread Joe
Nice plugin Mike... On Dec 30, 1:49 pm, "Michael Geary" wrote: > You can call setTimeout again and keep track of your loop counter, or you > can use setInterval. > > To make that easy, I posted a slowEach() plugin to this group a while back. > It may be just what you need. Here's the original po

[jQuery] Re: pausing jquery

2008-12-30 Thread Michael Geary
You can call setTimeout again and keep track of your loop counter, or you can use setInterval. To make that easy, I posted a slowEach() plugin to this group a while back. It may be just what you need. Here's the original post: http://groups.google.com/groups/search?q=sloweach+jquery+plugin Here

[jQuery] Re: pausing jquery

2008-12-30 Thread MorningZ
Pause on the server side then. On Dec 30, 1:18 pm, bwdev wrote: > Yes but the set TImeout seems to happen once.  I need it to pause on > each interation of the loop. > > On Dec 30, 1:05 pm, "Michael Geary" wrote: > > > Not only will that lock up the current browser, in many browsers it wil

[jQuery] Re: pausing jquery

2008-12-30 Thread bwdev
Yes but the set TImeout seems to happen once. I need it to pause on each interation of the loop. On Dec 30, 1:05 pm, "Michael Geary" wrote: > Not only will that lock up the current browser, in many browsers it will > lock up *every* browser window or tab. Plus, if someone is running on > batter

[jQuery] Re: pausing jquery

2008-12-30 Thread Michael Geary
Not only will that lock up the current browser, in many browsers it will lock up *every* browser window or tab. Plus, if someone is running on battery power it will drain the battery needlessly. As Richard said, setTimeout is the right solution: doSomething(); setTimeout( function() {

[jQuery] Re: pausing jquery

2008-12-30 Thread Richard D. Worth
If you don't want to lock the browser, use setTimeout https://developer.mozilla.org/En/DOM/Window.setTimeout - Richard On Tue, Dec 30, 2008 at 12:17 PM, Joe wrote: > > // Similar to PHP's sleep function. > function pause(numOfSeconds) { > >numOfSeconds *= 1000; >var startTime = new Dat

[jQuery] Re: pausing jquery

2008-12-30 Thread Joe
// Similar to PHP's sleep function. function pause(numOfSeconds) { numOfSeconds *= 1000; var startTime = new Date().getTime(); while (new Date().getTime() < startTime + numOfSeconds); return false; } // Let's pause for 5 seconds... pause(5); console.log('Awake Now'); A simple wa