From: Anthony Talarico Date: Wed, 29 Jun 2016 13:30:45 +0000 (-0400) Subject: changing jquery to detect number of products for the category gallery X-Git-Tag: v1.0.0^2~90 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=cf0c1a3401add23f35101838947afc9a869b9c40;p=WP-Themes%2Ffrancejourneys.git changing jquery to detect number of products for the category gallery --- diff --git a/js/app.js b/js/app.js index 0248936..7c9cbaa 100644 --- a/js/app.js +++ b/js/app.js @@ -96,10 +96,10 @@ $(document).ready(function () { $(this).find('img').remove(); }); - var products = $(".type-product").length; - - if(products == 2){ - $("#container").css("width", "700px"); + var products = $("ul.products").find("li.type-product").length; + console.debug(products); + if(products < 3 && products > 0){ + $("#container").css("width", "1000px"); } $(".html5_video_tab").find('a').html("Video"); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index d539c1d..3ea5a64 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -87,10 +87,10 @@ $(document).ready(function () { $(this).find('img').remove(); }); - var products = $(".type-product").length; - - if(products == 2){ - $("#container").css("width", "700px"); + var products = $("ul.products").find("li.type-product").length; + console.debug(products); + if(products < 3 && products > 0){ + $("#container").css("width", "1000px"); } $(".html5_video_tab").find('a').html("Video");