Commit 153ed3ae authored by imac's avatar imac

[Bugfix]Check disabled format

parent d7825e95
......@@ -32,6 +32,7 @@ function loadProductContent() {
$('.pa_format li').selectFormat();
$('.color-list.selected').selectSlide($('#slides'));
$.fn.getDownloadCurrentSlideLink();
$.fn.checkIfFormatDisabled ();
//$('.btn-wrapper.close-panel').addClass('int-link');
},300)
$('.download-btn:not(.download_file)').click(function(e){
......@@ -108,6 +109,19 @@ $(function(){
}
})
}
$.fn.checkIfFormatDisabled = function(){
var format = getUrlParameter('attribute_format');
var activeImg = $('.format-label #'+format).data('img-active');
$('.format-label #'+format).attr('src',activeImg);
$('.format-list').each(function() {
if ($(this).find("input").is(':disabled')) {
$(this).addClass("disabled");
}
else {
$(this).removeClass("disabled");
}
});
}
$.fn.getDownloadCurrentSlideLink = function(){
var img_link = $(document).find('.slick-current a').attr('href');
if(img_link){
......@@ -191,12 +205,23 @@ $(function(){
$('.product-details').css('right', 0);
})
}
$.fn.productAnimation = function(){
/********** NS *************/
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
//first format Actif
//var activeImg = $('.format-label #format_0').data('img-active');
//$('.format-label #format_0').attr('src',activeImg);
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
}
/*********** END NS ************/
$.fn.productAnimation = function(){
tlProduct = new TimelineMax();
tlProduct.fromTo('.product-images',0.4,{autoAlpha:0, marginLeft:"-10%"},{autoAlpha:1, marginLeft:"0"},0);
tlProduct.staggerFromTo('.product-details .list',0.4,{opacity:0, marginLeft:"-10%"},{opacity:1, marginLeft:"0"},0.4,0.2);
......@@ -216,4 +241,7 @@ $(function(){
});
})
loadProductContent();
});
\ No newline at end of file
});
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