Jquery accordion will not close after expanded.

Jquery accordion will not close after expanded.

Hello,

I hope to get some support here since I am unable to get it on a Wordpress Plugin Support page. We are using a plugin on Wordpress to get an accordion feature and it is using jQuery.

The problem is, after expanding an element, it will not close back. It acts like it will close but then comes right back open. Here is the current code:


  1.     /* Accordion */
        jQuery('.simnor-shortcode-toggle-active').each(function() {
            jQuery(this).find('.simnor-shortcode-toggle-content').show();
        });
        jQuery('.simnor-shortcode-toggle .simnor-shortcode-toggle-heading').click(function() {
            var toggle = jQuery(this).parent('.simnor-shortcode-toggle');
            if(jQuery(this).parent('.simnor-shortcode-toggle').parent('div').hasClass('simnor-shortcode-accordion')) {
                toggle.parent('div').find('.simnor-shortcode-toggle').find('.simnor-shortcode-toggle-content:visible').slideUp();
                toggle.parent('div').find('.simnor-shortcode-toggle-active').removeClass('simnor-shortcode-toggle-active');
                toggle.toggleClass('simnor-shortcode-toggle-active');
                toggle.find('.simnor-shortcode-toggle-content').slideToggle(500);
            } else {
                toggle.toggleClass('simnor-shortcode-toggle-active');
                toggle.find('.simnor-shortcode-toggle-content').slideToggle(500);
            }
        });