I have a section on my website where I want to implement an expand feature. I am currently using jQuery's toggleClass function to achieve this effect.
jQuery('.menux').click(function() {
jQuery(this).toggleClass('is-active');
jQuery('.a').toggleClass('a1');
jQuery('.b').toggleClass('b1');
jQuery('.c').toggleClass('c1');
});
The initial click triggers the animation perfectly. However, upon clicking for the second time, the animation fails to appear. Unlike the smooth downward movement during the first click. I tried adding a duration using
jQuery('.c').toggleClass('c1', 2000);
, but it didn't work as expected. How can I modify the animation so that it ascends slowly when clicked for the second time?
You can view my test here: https://jsfiddle.net/u6aztsgt/1/