var contextBlockHeight = document.getElementById(‘contextBlock‘).clientHeight; if ( contextBlockHeight > 430) { contextBlockHeight = contextBlockHeight + 50; document.getElementById(‘middleContextBlock‘).style.height = contextBlockHeight + "px"; }
<div id="contextBlock" class="mTop5 contextArea fontSize13"> </div>
原文:http://www.cnblogs.com/chankuang822/p/6856786.html