I've relied on Chris Coyier's Equal Height Blocks in Rows jQuery script for various projects, and it has consistently delivered great results.
However, this time I am facing a new challenge as I work on a responsive website with a fluid width main container. Unlike my previous projects with fixed resolutions, the fluid nature of the layout is causing an issue that I can't seem to resolve.
In his tutorial, Chris mentions adapting the script for fluid widths:
What About Fluid Width? One of the main advantages of using floated divs over tables is the ability to rearrange based on available horizontal space, especially useful for fluid layouts. The code can be modified to handle this by measuring block heights initially and retaining them with jQuery's data() method, then adjusting based on the original sizes rather than the resized dimensions during window resizes.
While the tutorial specifically addresses fluid width containers, my challenge lies with child elements within these fluid containers. These same elements with fluid widths are what need to be equalized, but their varying sizes depending on the container dimensions seem to disrupt the script's functionality.
I suspect that the changing 'originalHeight' property of the elements due to container resizing is causing the script to malfunction.
It's possible that my assumptions are incorrect, but regardless, the script does not seem to be effective with fluid width elements. Any assistance would be greatly appreciated!
For reference, here is a jsfiddle showcasing the issue. Simply adjust the window width to see that the container heights do not update accordingly.
To trigger the function on window resize, I'm using the following code:
$(window).resize(function() {
columnConform();
});
Thank you in advance for your help.