Dancer
Dancer

Reputation: 17671

Toggle hide() fast?

Is there a way to toggle an element quickly?

I have this at the moment:

 $('.appearLate, .topMnu').toggle('hide');

But it fades gradually by default. I need it to fade out fast but cant work out how to apply the attribute.

Can someone please tell me how i could do this?

Upvotes: 0

Views: 241

Answers (4)

Liam Allan
Liam Allan

Reputation: 1115

you can

$('.appearLate, .topMnu').slideToggle('fast');

or

$('.appearLate, .topMnu').fadeToggle('fast');

Upvotes: 0

Matt Indeedhat Holmes
Matt Indeedhat Holmes

Reputation: 725

$('.appearLate, .topMnu').toggle(100); //100 being number of milisecconds to perform translation

Upvotes: 0

Martin Bean
Martin Bean

Reputation: 39389

I think you’re looking for the fadeOut() function:

$(selector).fadeOut('fast');

Upvotes: 0

this will work

$('.appearLate, .topMnu').toggle('fast');
$('.appearLate, .topMnu').toggle(100); //pass time in milliseconds 

or

$('.appearLate, .topMnu').fadeOut('fast');
$('.appearLate, .topMnu').fadeOut(100);//pass time in milliseconds 

http://api.jquery.com/fadeOut/

Upvotes: 2

Related Questions