Make question close when opening another one
-
Hey guys,
Can you help me change the js script a bit. Once a user opens a question and reads it and then decides to open another question, the previous one should close (close the parent question). How can I do that?
Here is the js code:
$(function() { $('.qe-toggle-title').click(function () { 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 { $(this).find('i.fa').removeClass( 'fa-plus-circle' ).addClass( 'fa-minus-circle' ); parent_toggle.addClass( 'active' ).find( '.qe-toggle-content' ).slideDown( 'fast' ); } }); });
Thank you for your help
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Make question close when opening another one’ is closed to new replies.