$(document).ready(function(){ //左右对齐 var gd_l=$("#left").height(); var gd_r=$("#right").height(); if(gd_l<=gd_r){ $("#left").css("height",gd_r) } else{ $("#left").css("height",gd_l) } })