【原】让两个DIV高度一样的Javascript函数
<script type="text/javascript">
window.onload=window.onresize=function(){
var h1=document.getElementById("right").offsetHeight;
var h2=document.getElementById("left").offsetHeight;
if(h1>h2)
{
document.getElementById("left").style.height=h1+"px";
}
else
{
document.getElementById("right").style.height=h2+"px";
}
}
</script>
window.onload=window.onresize=function(){
var h1=document.getElementById("right").offsetHeight;
var h2=document.getElementById("left").offsetHeight;
if(h1>h2)
{
document.getElementById("left").style.height=h1+"px";
}
else
{
document.getElementById("right").style.height=h2+"px";
}
}
</script>