F-y-o-d-o-r
7/6/2018 - 9:18 AM

bootstrap 4 - accordion - change icons

bootstrap 4 - accordion - change icons

$('.collapse').on('shown.bs.collapse', function (event) {
    $(event.target).parent().find('button').addClass('footer__two-accordeon-change-plus');
  });
  $('.collapse').on('hidden.bs.collapse', function (event) {
    $(event.target).parent().find('button').removeClass('footer__two-accordeon-change-plus');
  });
  
  ====================
  
  $('#accordion').on('show.bs.collapse', function (event) {
    $('#accordion').find('button').html('<svg class="shop-plus-aside svg"><use xlink:href="#shop-plus"></use></svg>');
    $(event.target).parent().find('button').html('<svg class="shop-minus-aside svg"><use xlink:href="#shop-minus"></use></svg>');
  })
  $('#accordion').on('hidden.bs.collapse', function (event) {
    $(event.target).parent().find('button').html('<svg class="shop-plus-aside svg"><use xlink:href="#shop-plus"></use></svg>');
  });