testing number of product based width for container
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 28 Jun 2016 17:43:12 +0000 (13:43 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 28 Jun 2016 17:43:12 +0000 (13:43 -0400)
js/app.js
js/custom/pageSetup.js

index 6a846cb..7acf07e 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -94,5 +94,12 @@ $(document).ready(function () {
         $(this).css("height", 175).css("width", 'auto');
         $(this).css("background", 'url(' + src + ') no-repeat center center').css("background-size", "cover");
         $(this).find('img').remove();
-    });  
+    });
+    
+    var products = $(".type-product").length;
+    console.debug(products);
+    
+    if(products > 3){
+        $("#container").css("width", "700px");
+    }
 });
index e9b4d24..0ff494c 100644 (file)
@@ -85,5 +85,12 @@ $(document).ready(function () {
         $(this).css("height", 175).css("width", 'auto');
         $(this).css("background", 'url(' + src + ') no-repeat center center').css("background-size", "cover");
         $(this).find('img').remove();
-    });  
+    });
+    
+    var products = $(".type-product").length;
+    console.debug(products);
+    
+    if(products > 3){
+        $("#container").css("width", "700px");
+    }
 });