I've used Chris Coyiers Equal Height Blocks in Rows jQuery script many times before, and it's always worked great.
That being said, I've always developed websites built for a specific resolution. This time around I'm developing a responsive website and main container has a fluid width. As such, I've encountered an issue and can't find a solution to my problem.
In his post, Chris says this about fluid widths:
What About Fluid Width? One of the main points of not using a table for this is that floated divs can rearrange themselves based on the available horizontal space, which is nice for fluid width. We can adjust the above code to deal with that as well. Basically the first time this is run we'll measure the height of each block and remember it with jQuery's data() method. Then when the window is resized, run the code again but use the original size to adjust the rows, not the new size.
Note that he's specifically referencing a fluid width container. In my case it's not just the container, but the child elements that also have fluid widths. The very blocks that I need to equalize are the same blocks have fluid widths and adjust to the resolution of the window/container.
I believe that because the element's 'originalHeight' changes with the container size, the script will no longer work properly.
My speculation may be wrong, but one way or another this isn't working with fluid width elements. Looking for some help!
Of course, here's a jsfiddle I created to demonstrate the problem. Just resize the width of the window and you'll notice the heights of the containers do not update.
I'm running the following code to call the function on the window resize event:
$(window).resize(function() {
columnConform();
});
Thanks in advance