I used this script to get the width and then apply it to one element:
$(document).ready(function(){
$(".equal-height").each(function(){
var slideSize = $(this).outerWidth();
console.log(slideSize);
$(this).css({ "height" : slideSize + "px" });
});
});
However, for some reason there are elements that sometimes do not get the appropriate width and height. As you can see in this fiddle: https://jsfiddle.net/cpfgtuzo/5/ the last element has the correct dimensions, and the rest are all above their width. I am trying to make them all be square, and I also need to support older browsers.
This only seems to be a problem when the window size is smaller and the four elements flow in 2 columns.
source
share