views:

417

answers:

4

I have found http://stackoverflow.com/questions/734554/jquery-fadeout-then-slideup and it's good, but it's not the one.

How can I fadeOut() and slideUp() at the same time? I tried two separate setTimeout() calls with the same delay but the slideUp() happened as soon as the page loaded.

Has anyone done this?

Thanks

+1  A: 

Why don't you just slideUp? When it's done it's not visible anyway. Or use the animate function instead.

poo
+4  A: 

You can do something like this, this is a full toggle version:

$("#mySelector").animate({ height: 'toggle', opacity: 'toggle' }, 'slow');

For strictly a fadeout:

$("#mySelector").animate({ height: 0, opacity: 0 }, 'slow');
Nick Craver
*bonks Nick* Those `'show'` should be `'toggle'`
R. Bemrose
@Powerlord - Woops you're right, was testing the showing here, doh
Nick Craver
A: 

Check out the jquery cycle plugin. It might be what you need.

mdm20
A: 

I'm not sure if you want to actually slide up the object or use jQuery's slideUp method with makes the object kind of fold into itself. If it's the latter then just chain them together

('#testDiv').slideUp().fadeOut();

If it's the former then you'll need to use the animate function changing the top value and setting opacity = 'hide'

Also, if you don't want it to start when the doc loads, make it depend on an event such as mouseOver, or click, or you could use jQuery's delay()

Justen