How to close one unit, if you open another?

https://codepen.io/Harmon68/pen/EzqopE

Got to do to toggleClass, but there is no smoothness, I would like to do using slideToggle to smoothly.
It is necessary so that when you open the lesson close smoothly another that only one was active.
Thanks in advance.
March 23rd 20 at 19:39
2 answers
March 23rd 20 at 19:41
Use callback
.slideToggle(1000, function (){
// Here we close another block
})
$('.open_video').on('click', function() {
$(this)
.closest('.wrapper_video')
.find('.about_video')
 .slideToggle(2000, function() {
$(this).closest('.wrapper_video').find(".about_video").slideToggle(1000);
 });


Closes the block where the button is pressed - Harmon68 commented on March 23rd 20 at 19:44
March 23rd 20 at 19:43

Find more questions by tags jQuery