philbuchanan / Accordion-Shortcodes

A WordPress plugin that adds a few shortcodes to allow for accordion dropdowns.
https://wordpress.org/plugins/accordion-shortcodes/
16 stars 10 forks source link

can I get open close button ? #63

Closed dineshdedhia closed 7 years ago

philbuchanan commented 7 years ago

This is not likely something I will add to the plugins core functionality, but you can achieve it using this code:

<button class="js-open-everything">Open Everything</button>
jQuery(document).ready(function($) {
  $('.js-open-everything').click(function() {
    $.each($('.accordion-title'), function(index, value) {
      if (!$(this).hasClass('open')) {
        $(this).click();
      }
    });
  });
});
dineshdedhia commented 7 years ago

Hello,

Thanks alot :) Cheers

On Fri, Apr 14, 2017 at 4:25 AM, Phil Buchanan notifications@github.com wrote:

This is not likely something I will add to the plugins core functionality, but you can achieve it using this code:

jQuery(document).ready(function($) { $('.js-open-everything').click(function() { $.each($('.accordion-title'), function(index, value) { if (!$(this).hasClass('open')) { $(this).click(); } }); }); });

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/philbuchanan/Accordion-Shortcodes/issues/63#issuecomment-294042366, or mute the thread https://github.com/notifications/unsubscribe-auth/ALcxZTG6MIRVNZwmiRGCvEaBNYYSkMxkks5rvqfrgaJpZM4M8ldF .

-- Thanks & Regards,