Bootstrap Tutorial - Use Javascript to align well high








The following code shows how to use Javascript to align well high.

Example

<!--  w w  w  .  ja  v a  2s.c o  m-->
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.8.3.js'></script>
<style type='text/css'>
@import url(http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.0/css/bootstrap-combined.min.css);
</style>
<script type='text/javascript'>//<![CDATA[ 
$(window).load(function(){
boxes = $('.well');
maxHeight = Math.max.apply(Math, boxes.map(function() {
    return $(this).height();
}).get());
boxes.height(maxHeight);
});
</script>
</head>
<body>
  <div class="row">
    <div class="span3 well">
      <p>I'm really short</p>
    </div>
    <div class="span3 well">
      <p>I'm in the middle</p>
      <p>I'm in the middle</p>
      <p>I'm in the middle</p>
    </div>
    <div class="span3 well">
      <p>I'm really long</p>
      <p>I'm really long</p>
      <p>I'm really long</p>
      <p>I'm really long</p>
      <p>I'm really long</p>
      <p>I'm really long</p>
    </div>
  </div>
</body>
</html>

Click to view the demo