Reputation: 17671
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
Reputation: 1115
you can
$('.appearLate, .topMnu').slideToggle('fast');
or
$('.appearLate, .topMnu').fadeToggle('fast');
Upvotes: 0
Reputation: 725
$('.appearLate, .topMnu').toggle(100); //100 being number of milisecconds to perform translation
Upvotes: 0
Reputation: 39389
I think you’re looking for the fadeOut() function:
$(selector).fadeOut('fast');
Upvotes: 0
Reputation: 57095
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