Commit 153ed3ae authored by imac's avatar imac

[Bugfix]Check disabled format

parent d7825e95
...@@ -32,6 +32,7 @@ function loadProductContent() { ...@@ -32,6 +32,7 @@ function loadProductContent() {
$('.pa_format li').selectFormat(); $('.pa_format li').selectFormat();
$('.color-list.selected').selectSlide($('#slides')); $('.color-list.selected').selectSlide($('#slides'));
$.fn.getDownloadCurrentSlideLink(); $.fn.getDownloadCurrentSlideLink();
$.fn.checkIfFormatDisabled ();
//$('.btn-wrapper.close-panel').addClass('int-link'); //$('.btn-wrapper.close-panel').addClass('int-link');
},300) },300)
$('.download-btn:not(.download_file)').click(function(e){ $('.download-btn:not(.download_file)').click(function(e){
...@@ -108,6 +109,19 @@ $(function(){ ...@@ -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(){ $.fn.getDownloadCurrentSlideLink = function(){
var img_link = $(document).find('.slick-current a').attr('href'); var img_link = $(document).find('.slick-current a').attr('href');
if(img_link){ if(img_link){
...@@ -191,12 +205,23 @@ $(function(){ ...@@ -191,12 +205,23 @@ $(function(){
$('.product-details').css('right', 0); $('.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 for (i = 0; i < sURLVariables.length; i++) {
//var activeImg = $('.format-label #format_0').data('img-active'); sParameterName = sURLVariables[i].split('=');
//$('.format-label #format_0').attr('src',activeImg);
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
}
/*********** END NS ************/
$.fn.productAnimation = function(){
tlProduct = new TimelineMax(); tlProduct = new TimelineMax();
tlProduct.fromTo('.product-images',0.4,{autoAlpha:0, marginLeft:"-10%"},{autoAlpha:1, marginLeft:"0"},0); 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); tlProduct.staggerFromTo('.product-details .list',0.4,{opacity:0, marginLeft:"-10%"},{opacity:1, marginLeft:"0"},0.4,0.2);
...@@ -217,3 +242,6 @@ $(function(){ ...@@ -217,3 +242,6 @@ $(function(){
}) })
loadProductContent(); loadProductContent();
}); });
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