Response title
This is preview!
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<style type="text/css">
#container div {
float: left;
width: 30.3%;
margin: 0 1%;
background: grey;
}
</style>
</head>
<body>
<div id="container">
<div>
<h3>Div One</h3>
<p>Paragraphs of varying length.</p>
</div>
<div>
<h3>Div Two</h3>
<p>Paragraph two</p>
</div>
<div>
<h3>Div Three</h3>
<p>The point is that the height of each of the divs can vary because of the paragraphs.</p>
</div>
</div>
<script>
$ (
function() {
var fhf = $("#container div:first").innerHeight();
var fhl = $("#container div:last").innerHeight();
if (fhl > fhf) {
$("#container div").each(function() {
$(this).css('height', fhl);
});
}
else {
$("#container div").each(function() {
$(this).css('height', fhf);
});
}
});
</script>
</body>
</html>
© 2013 jQuery Foundation
Sponsored by and others.