JQuery simultaneously switches animation "slide" and "fading"

jQuery has slideToggle and a fadeToggle , but they interact poorly (see script here ):

 $('div').on('click', function () { $('span') .slideToggle({duration: 'slow', queue: false}) .fadeToggle({duration: 'slow', queue: false}); }); 

How can I switch slide and fade at the same time?

+6
source share
1 answer

Use .animate() as follows:

 $('span').animate({ height: "toggle", opacity: "toggle" }); 
+13
source

All Articles