Reputation: 116403
jQuery has a slideToggle
, and a fadeToggle
, but they don't play well together (see fiddle here):
$('div').on('click', function () {
$('span')
.slideToggle({duration: 'slow', queue: false})
.fadeToggle({duration: 'slow', queue: false});
});
How can I have slide
and fade
toggle at the same time?
Upvotes: 6
Views: 5706
Reputation: 116403
Use .animate()
as follows:
$('span').animate({
height: "toggle",
opacity: "toggle"
});
Upvotes: 17