You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

24 lines
636 B

import $ from 'jquery';
$(document).ready(function () {
let tabs = $('.js-tabs');
if (tabs.length) {
tabs.each(function(){
let _this = $(this),
btn = _this.find('.js-tabs-btn'),
item = _this.find('.js-tabs-item');
btn.on('click', function(e){
e.preventDefault();
let _thisBtn = $(this),
index = _thisBtn.index();
btn.removeClass('active');
_thisBtn.addClass('active');
item.hide();
item.eq(index).fadeIn();
});
});
}
});