Support » Plugin: Quick and Easy FAQs » Collapse FAQ when selecting another + toggle

  • If you are using toggle mode and would like to collapse a previously opened FAQ when selecting another, you can make these simple changes to public-scripts.js — look for the 4 lines with the comment “// pmona add” on the end.

    /**
    * FAQs Toggles
    */
    $(function() {
    $(‘.qe-toggle-title’).click(function () {
    var all_toggles = $(‘.qe-faq-toggle’); //pmona add
    var parent_toggle = $(this).closest(‘.qe-faq-toggle’);
    if ( parent_toggle.hasClass( ‘active’ ) ) {
    $(this).find(‘i.fa’).removeClass( ‘fa-minus-circle’ ).addClass( ‘fa-plus-circle’ );
    parent_toggle.removeClass( ‘active’ ).find( ‘.qe-toggle-content’ ).slideUp( ‘fast’ );
    } else {
    all_toggles.removeClass( ‘nojs active’ ); //pmona add
    all_toggles.find(‘i.fa’).removeClass( ‘fa-minus-circle’ ).addClass( ‘fa-plus-circle’ ); //pmona add
    all_toggles.removeClass( ‘active’ ).find( ‘.qe-toggle-content’ ).slideUp( ‘fast’ ); //pmona add
    $(this).find(‘i.fa’).removeClass( ‘fa-plus-circle’ ).addClass( ‘fa-minus-circle’ );
    parent_toggle.addClass( ‘active’ ).find( ‘.qe-toggle-content’ ).slideDown( ‘fast’ );
    }
    });
    });

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Collapse FAQ when selecting another + toggle’ is closed to new replies.