GeorgeWang地字3号

JQuery、Node.js http://www.pecloud.cn/

导航

jquery 保持div的列高度相同

$(document).ready(function() {

  function equalHeight(group) {

    tallest = 0;

    group.each(function() {

      thisHeight = $(this).height();

      if (thisHeight > tallest) {

        tallest = thisHeight;

      }

    });

    group.height(tallest);

  }

 

  // how to use

  $(document).ready(function() {

    equalHeight($(".left"));

    equalHeight($(".right"));

  });

});

posted on 2011-02-20 14:09  GeorgeWang  阅读(178)  评论(0编辑  收藏  举报