$(function () { function activateProductBox(boxHref) { $('.row', productList).removeClass('active') $(productList).find(`#${boxHref}`).addClass('active') console.log($(productList).find(`#${boxHref}`)) } var productList = $('.colors-preview') $('.colors-preview', productList).first().addClass('active') $('#nav_tabs li a').on('click', function () { event.preventDefault() var boxHref = $(this).attr('href').substring(1) $(this).parent().parent().find('li').removeClass('active') $(this).parent().addClass('active') activateProductBox(boxHref) }) $('#nav_tabs li').first().addClass('active') $('#characteristics-box .scontainer-content .row').first().addClass('active') }) $(function () { $('#scontainer-83 .box-data ul li').on('click', function () { $('#scontainer-83 .box-data ul li') .not($(this)) .find('p') .removeClass('active') $(this).find('p').toggleClass('active') }) }) $(function() { if ($('#glassingApp').length) { $('body').on('click', '.box-3 .tabs-nav .tab-item', function(e) { e.preventDefault() let tabId = $(this).data('tab') let isActive = $(this).hasClass('active') $('.box-3 .tabs-nav .tab-item').removeClass('active') $('.box-3 .tab-content').removeClass('active').slideUp() if (!isActive) { $(this).addClass('active') $(`.box-3 .tab-content[id="${tabId}"]`).addClass('active').slideDown() } }) } })