var processHeightJsNodes = []; function processHeightAdjust() { var processHeightJsNodes = processHeightJsNodes || []; if(! processHeightJsNodes[0]){ for (i = 0; i < arguments.length; i++) { processHeightJsNodes.push(document.getElementsByClassName(arguments[i])); } } for (i = 0; i < processHeightJsNodes.length; i++) { var max = 0; var elements = []; elements = processHeightJsNodes[i]; for (x = 0; x < elements.length; x++) { elements[x].style.setProperty("height","auto"); //elements[x].removeAttribute("style"); if(elements[x].clientHeight > max) max=Math.ceil(elements[x].clientHeight); } for (y = 0; y < elements.length; y++) { elements[y].style.setProperty("height",max+"px"); } } } // CSS Fix // ======== $(window).on("load", function() { processHeightAdjust('title'); processHeightAdjust('excerpt'); processHeightAdjust('category-thumb'); processHeightAdjust('product-thumb'); processHeightAdjust('ProductResult'); processHeightAdjust('CategoryResult'); processHeightAdjust('ShopProd_Listing_Dimensions'); }); $(window).on("resize", function() { processHeightAdjust('title'); processHeightAdjust('excerpt'); processHeightAdjust('category-thumb'); processHeightAdjust('product-thumb'); processHeightAdjust('ProductResult'); processHeightAdjust('CategoryResult'); processHeightAdjust('ShopProd_Listing_Dimensions'); }); $(window).bind("load", function() { // product box heights // title and description // var $nMaxHeight = 0; // $(".title_and_desc").each(function(){ // // If this box is bigger than the current max // if($(this).height() > $nMaxHeight) // { // // Set the max height to this boxes height // $nMaxHeight = $(this).height(); // } // }); // // // For each box, set it's height to the max // $(".title_and_desc").each(function(){ // $(this).height(Math.ceil($nMaxHeight)); // }); // item code var $nMaxHeight = 0; $(".itemcode").each(function(){ // If this box is bigger than the current max if($(this).height() > $nMaxHeight) { // Set the max height to this boxes height $nMaxHeight = $(this).height(); } }); // For each box, set it's height to the max $(".itemcode").each(function(){ $(this).height(Math.ceil($nMaxHeight)); }); // dimensions var $nMaxHeight = 0; $(".ShopProd_Listing_Dimensions").each(function(){ // If this box is bigger than the current max if($(this).height() > $nMaxHeight) { // Set the max height to this boxes height $nMaxHeight = $(this).height(); } }); // For each box, set it's height to the max $(".ShopProd_Listing_Dimensions").each(function(){ $(this).height(Math.ceil($nMaxHeight)); }); // price box var $nMaxHeight = 0; $(".ShopProd_Listing_Price").each(function(){ // If this box is bigger than the current max if($(this).height() > $nMaxHeight) { // Set the max height to this boxes height $nMaxHeight = $(this).height(); } }); // For each box, set it's height to the max $(".ShopProd_Listing_Price").each(function(){ $(this).height(Math.ceil($nMaxHeight)); }); // main box var $nMaxHeight = 0; $(".product.CatListBox.ProductResult").each(function(){ // If this box is bigger than the current max if($(this).height() > $nMaxHeight) { // Set the max height to this boxes height $nMaxHeight = $(this).height(); } }); // For each box, set it's height to the max $(".product.CatListBox.ProductResult").each(function(){ $(this).height(Math.ceil($nMaxHeight)); }); // set category result boxes to the same height $nMaxHeight = 0; $(".product.CatListBox.CategoryResult").each(function(){ // If this box is bigger than the current max if($(this).height() > $nMaxHeight) { // Set the max height to this boxes height $nMaxHeight = $(this).height(); } }); // For each box, set it's height to the max $(".product.CatListBox.CategoryResult").each(function(){ $(this).height(Math.ceil($nMaxHeight)); }); });