-
AuthorPosts
-
April 9, 2014 at 9:57 am #31557
Hi, I want to set the option of “expand all” and “close all” for the accordions.
Thanks.
April 9, 2014 at 9:57 am #31558This reply has been marked as private.April 9, 2014 at 4:37 pm #31762Hi Antonela,
You could do this by adding this javascript under Customizer > Custom > Javascript .
Let say you add expand and collapse all button at your editor
<a href="#" class="expandall_accord">Expand All</a> | <a href="#" class="collapseall_accord">Collapse All</a>
jQuery('.expandall_accord').on('click', function(){ jQuery('.accordion-body').collapse('show'); }); jQuery('.collapseall_accord').on('click', function(){ jQuery('.accordion-body').collapse('hide'); });
Hope this helps.
April 10, 2014 at 9:32 am #32038Thanks!
April 10, 2014 at 12:35 pm #32134You’re welcome! Take care
October 25, 2015 at 7:53 pm #639291Very helpful – thank you!
October 25, 2015 at 9:41 pm #639368You’re most welcome!
April 8, 2016 at 12:04 pm #873088This reply has been marked as private.April 9, 2016 at 2:58 am #873853Hi there,
Please update your javascript code to this,
jQuery ( function($) { $('.expandall_accord').on('click', function( e ){ $('.x-accordion-body').collapse('show'); e.preventDefault(); }); $('.collapseall_accord').on('click', function( e ){ $('.x-accordion-body').collapse('hide'); e.preventDefault(); }); } );
Cheers!
April 9, 2016 at 10:52 am #874250Thanks – that worked like a charm!
April 10, 2016 at 12:18 am #874810You’re welcome.
-
AuthorPosts