I guess it's not well known that there's a plugin in the wild, Pause, which does the same thing. The original is at http://blog.mythin.net/projects/jquery.php -- you can find that link at the docs.jquery.com/Plugins wiki. However, the queue method changed around the 1.2 (I think) release, so for current versions y'all are welcome to leech my updated pause script at http://www.doublerebel.com/scripts/jquery.pause.js . There is also another suggested method at http://www.learningjquery.com/2007/01/effect-delay-trick which (ab)uses the animate method as a timer.
It is a very useful tool but I don't think it's ready for the jQuery core yet, as you can see there are very complicated and very simple ways to wait/pause the jQuery execution chain -- we'd have to standardize a method first. Charles doublerebel.com On Oct 30, 11:32 am, "Tane Piper" <[EMAIL PROTECTED]> wrote: > I dunno, I'm one of these people starting to really see the benefits > of keeping as much out the core as possible, as jQuery's plugin > architecture doesn't add any overhead, although I'm starting to link > along the lines of jQuery.core.js and jQuery.utilities.js, where > functions like this come as part of a core package, but are not > required by the core. > > On 30/10/2007, Andy Matthews <[EMAIL PROTECTED]> wrote: > > > > > > > I think that something like this is a good candidate for the core. There's > > so many requests and things for "how can I pause my code", etc. > > > I can't see this being all that large in size. > > > -----Original Message----- > > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On > > Behalf Of Tane Piper > > Sent: Tuesday, October 30, 2007 12:32 PM > > To: jquery-en@googlegroups.com > > Subject: [jQuery] [INTERESTING PLUGIN] Wait plugin > > > I came across an interesting plugin today on my travels around the web: > > >http://blog.jcoglan.com/2007/10/30/asynchronous-function-chaining-in-... > > ipt > > > It's interesting, because it's a setTimeout plugin but is coded so it can be > > chained along my event queue. For example, in my code before I > > had: > > > $(self).animate({top: -90, opacity: 0.9}, 2000); > > setTimeout(function() { > > $(self).animate({ top: -150, opacity: 0 }, 1000); }, > > 5000); > > > But using this plugin, I can now do: > > > $(self).animate({top: -90, opacity: 0.9}, 2000).wait(5).then.animate({ > > top: -150, opacity: 0 }, 1000); > > > To me, this makes a lot of sense, and also looks more jQuery-like. > > Kudos for the developer for making this one. > > > -- > > Tane Piper > > Blog -http://digitalspaghetti.me.uk > > AJAX Pastebin -http://pastemonkey.org > > > This email is: [ ] blogable [ x ] ask first [ ] private > > -- > Tane Piper > Blog -http://digitalspaghetti.me.uk > AJAX Pastebin -http://pastemonkey.org > > This email is: [ ] blogable [ x ] ask first [ ] private