Sha256: 265be67610092ad77cb992fdb1a088bb898e693329a056b3d93fb3c39d52c428

Contents?: true

Size: 672 Bytes

Versions: 12

Compression:

Stored size: 672 Bytes

Contents

$(document).ready(function () {
  $('.accordion-tabs').each(function(index) {
    $(this).children('li').first().children('a').addClass('is-active').next().addClass('is-open').show();
  });

  $('.accordion-tabs').on('click', 'li > a', function(event) {
    if (!$(this).hasClass('is-active')) {
      event.preventDefault();
      var accordionTabs = $(this).closest('.accordion-tabs');
      accordionTabs.find('.is-open').removeClass('is-open').hide();

      $(this).next().toggleClass('is-open').toggle();
      accordionTabs.find('.is-active').removeClass('is-active');
      $(this).addClass('is-active');
    } else {
      event.preventDefault();
    }
  });
});

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
breezeblocks-0.0.4 source/javascripts/breezeblocks/accordion_tabs.js
breezeblocks-0.0.2 source/javascripts/breezeblocks/accordion_tabs.js
breezeblocks-0.0.1 source/javascripts/breezeblocks/accordion_tabs.js
refills-0.1.0 source/javascripts/refills/accordion_tabs.js
staple-0.0.9 source/javascripts/staple/accordion_tabs.js
staple-0.0.8 source/javascripts/staple/accordion_tabs.js
staple-0.0.7 source/javascripts/staple/accordion_tabs.js
staple-0.0.6 source/javascripts/staple/accordion_tabs.js
staple-0.0.5 source/javascripts/staple/accordion_tabs.js
staple-0.0.4 source/javascripts/staple/accordion_tabs.js
staple-0.0.3 source/javascripts/staple/accordion_tabs.js
staple-0.0.2 source/javascripts/staple/accordion_tabs.js