div随另一个div自动增高

<script type="text/javascript">
document.getElementById("div1").style.height=document.getElementById("zg").scrollHeight+"px";
document.getElementById("div2").style.height=document.getElementById("zg").scrollHeight-2+"px";
</script>

<div id="zg">

<div id="div1"></div><div id="div2"></div>

</div>

posted @ 2013-06-18 17:23  Liu66~  阅读(607)  评论(0编辑  收藏  举报