Save
This commit is contained in:
@@ -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")
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user