码迷,mamicode.com
首页 > Web开发 > 详细

JQuery控制两个Div高度一致

时间:2017-12-12 20:51:10      阅读:227      评论:0      收藏:0      [点我收藏+]

标签:title   string   else   相同   ram   css   gpo   ext   pos   

<script type="text/javascript">
$(function(){
if($("#left").height() > $("#right").height()){
$("#right").css("height",$("#left").height());
}else{
$("#left").css("height",$("#right").height());
}
})
</script>

修改过的
jQuery控制两个div高度相同代码
<script type="text/javascript">
$(function(){
if($("#left").height() > $("#right").height()){
$("#right").css("height",$("#left").height());
}else{
$("#left").css("height",$("#right").height());
}
})
</script>



JQuery控制两个Div高度一致

标签:title   string   else   相同   ram   css   gpo   ext   pos   

原文地址:http://www.cnblogs.com/wangshengli520/p/8028639.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!