Re: [jQuery] How to block a function while another finishes? (and pause!)

2007-03-03 Thread Kim Johnson
Thanks to both of you! :) this is exactly what I needed. Question 2: is there a way to pause the slidedown from happening? I notice there's a pause() plugin, I dl'ed that and attempted to chain it such as: target.slideUp(slow, function() {

Re: [jQuery] How to block a function while another finishes? (and pause!)

2007-03-03 Thread Klaus Hartl
Kim Johnson schrieb: Thanks to both of you! :) this is exactly what I needed. Question 2: is there a way to pause the slidedown from happening? I notice there's a pause() plugin, I dl'ed that and attempted to chain it such as: target.slideUp(slow, function() {

Re: [jQuery] How to block a function while another finishes? (and pause!)

2007-03-03 Thread Karl Swedberg
On Mar 3, 2007, at 3:05 PM, Klaus Hartl wrote: Karl recently wrote about a neat trick to achieve the same without the pause plugin: http://www.learningjquery.com/2007/01/effect-delay-trick Just do this: target.children(div.middle).html(stuff).pause(2000, 'fx').animate({opacity: 1},

[jQuery] How to block a function while another finishes?

2007-03-02 Thread Kim Johnson
I'm having a hard time getting functions to happen in the order I want them to. Specifically, I need the html of a div to be rewritten BEFORE it slides back down. I'm seeing the html change while the div is sliding up, which isn't what I'm looking for. Is there any way to force functions to finish

Re: [jQuery] How to block a function while another finishes?

2007-03-02 Thread Chris Domigan
The effect methods in jQuery take an optional callback parameter. The callback function is called when the animation is complete. So you can do: $divTarget = $(divTarget); $divTarget.slideUp(slow, function() { $divTarget.children(div.middle).html(stuff); $divTarget.slideDown(slow); });

Re: [jQuery] How to block a function while another finishes?

2007-03-02 Thread Klaus Hartl
Kim Johnson schrieb: I'm having a hard time getting functions to happen in the order I want them to. Specifically, I need the html of a div to be rewritten BEFORE it slides back down. I'm seeing the html change while the div is sliding up, which isn't what I'm looking for. Is there any way