tabs.js 398 B

1234567891011121314
  1. import $ from 'jquery';
  2. $('body').on('touchstart click', '[data-tabid]', (event) => {
  3. event && event.stopPropagation();
  4. let target = $(event.currentTarget);
  5. const panel = $(`[id="${target.data('tabid')}"]`);
  6. target.siblings('[data-tabid]').removeClass('active');
  7. target.addClass('active');
  8. panel.siblings('[id]').removeClass('active');
  9. panel.addClass('active');
  10. });