This commit is contained in:
Roman Pyrih
2024-12-05 16:59:56 +01:00
parent e593c62e5a
commit 12d666b24e
9 changed files with 136 additions and 12 deletions

View File

@@ -305,4 +305,26 @@ $(function () {
// $("html, body").animate({ scrollTop: 0 }, "slow");
// })
// }
// })
// })
$(function() {
var productColorsList = $("#product-colors-preview-box .scontainer-content")
$("#nav_tabs_colors li a").on("click", function (e) {
e.preventDefault()
var boxColorHref = $(this).attr("href").substring(1)
$(this).parent().parent().find("li").removeClass("active")
$(this).parent().addClass("active")
activateProductColorsBox(boxColorHref)
})
$("#nav_tabs_colors li").first().addClass("active")
$(".colors-preview", productColorsList).first().addClass("active")
function activateProductColorsBox(boxColorHref) {
$(".colors-preview", productColorsList).removeClass("active")
$(productColorsList).find(`#${boxColorHref}`).addClass("active")
}
})