(function ($) { "use strict"; $(function () { $('.jnews-faq-wrapper').each(function () { var base = $(this); $(this).find('.list-toogle').on('click', function (e) { e.preventDefault(); const listWrapper = $(this).closest('.list-wrapper'); if (listWrapper.hasClass('expand')) { listWrapper.find('.card-expand').slideUp(); listWrapper.removeClass('expand'); } else { base.find('.card-expand').slideUp(); base.find('.list-wrapper').removeClass('expand'); listWrapper.addClass('expand'); listWrapper.find('.card-expand').slideDown(); } }); }); }); })(jQuery);