Commit dcfb8e69 authored by imac's avatar imac

[Update]Product : Add image for format

parent 597ac810
...@@ -1077,6 +1077,11 @@ aside.news-wrapper { ...@@ -1077,6 +1077,11 @@ aside.news-wrapper {
.list-format li.disabled{ .list-format li.disabled{
color: rgba(26,26,26,0.2); color: rgba(26,26,26,0.2);
} }
.list-format li.disabled img{
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
opacity: 0.4;
}
.list li.selected >span:first-child::after{ .list li.selected >span:first-child::after{
content:''; content:'';
height: 14px; height: 14px;
......
...@@ -39,7 +39,7 @@ $.fn.getListFormat = function(){ ...@@ -39,7 +39,7 @@ $.fn.getListFormat = function(){
formatWrapper.css({'height' : formatH , 'width' : formatW }); formatWrapper.css({'height' : formatH , 'width' : formatW });
}) })
} }
$.fn.selectColorFormat = function(){ $.fn.selectColor= function(){
$(this).on('click',function(){ $(this).on('click',function(){
$(this).parent().parent().find('li').removeClass('selected'); $(this).parent().parent().find('li').removeClass('selected');
if (!($(this).hasClass('disabled'))){ if (!($(this).hasClass('disabled'))){
...@@ -47,6 +47,25 @@ $.fn.selectColorFormat = function(){ ...@@ -47,6 +47,25 @@ $.fn.selectColorFormat = function(){
} }
}) })
} }
$.fn.selectFormat = function(){
$(this).on('click',function(){
var actifImage = $(this).find('img').data('img-active'),
initialImage = $(this).find('img').data('img');
$(this).parent().parent().find('li').each(function(){
img = $(this).find('img');
img.attr('src',img.data('img'));
})
$(this).parent().parent().find('li').removeClass('selected');
if (!($(this).hasClass('disabled'))){
$(this).toggleClass('selected');
}
if ($(this).hasClass('selected')){
$(this).find('img').attr('src',actifImage);
}else{
$(this).find('img').attr('src',initialImage);
}
})
}
$.fn.slider_product = function(){ $.fn.slider_product = function(){
$('#slides').not('.slick-initialized').slick({ $('#slides').not('.slick-initialized').slick({
autoplay: false, autoplay: false,
...@@ -113,8 +132,9 @@ $('.product-list article img, .product-list article ul li').on('click', function ...@@ -113,8 +132,9 @@ $('.product-list article img, .product-list article ul li').on('click', function
$('.load-page').parent().addClass('active'); $('.load-page').parent().addClass('active');
$('.load-page').load(toLink,function(){ $('.load-page').load(toLink,function(){
$('.list-color li').getListColors(); $('.list-color li').getListColors();
$('.list-format li').getListFormat(); //$('.list-format li').getListFormat();
$('.list li').selectColorFormat(); $('.list-color li').selectColor();
$('.list-format li').selectFormat();
$('#zoom').zoom(); $('#zoom').zoom();
$('article[data-color], .list-color li span').selectSlide($('#slides')); $('article[data-color], .list-color li span').selectSlide($('#slides'));
$('#mozaique').open_gallery(); $('#mozaique').open_gallery();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment