这样呢?
document.getElementById("pro_man_action").offsetWidth

解决方案 »

  1.   

    document.getElementById("pro_man_action").offsetHeight
      

  2.   

    我是菜鸟,请问这个offheight与height是不是区别是一个定义一个为定义阿?
      

  3.   

    我输出了一下,可以没有反应阿,还有这个DIV的高度是自动的,也就是未设置高度<script>
    alert(document.getElementById("pro_man_action").offsetHeight);
      </script>
      

  4.   


    function bbq(){ 
    alert(document.getElementById("pro_man_action").offsetHeight); 
    }
    window.onload = bbq;
      

  5.   

    如果我想要另一个DIV的高度随着这个DIV的高度改变是不是应该这么写
      function man_menu_height()
    {document.getElementById("pro_man_menu").style.height=document.getElementById("pro_man_action").offsetHeight);}
    window.onload=man_menu_height;可是没效果,估计又错了
      

  6.   

    document.getElementById("sideleft").style.height=document.getElementById("sideright").scrollHeight+"px"
      

  7.   

    回楼上的document.getElementById("sideleft").style.height=document.getElementById("sideright").scrollHeight+"px"
      

  8.   

    那为什么非要用onload的,直接写在叶面里不可以吗
      

  9.   

    可是我试了一下,直接放入
    <script>
    document.getElementById("pro_man_menu").style.height=document.getElementById("pro_man_action").scrollHeight-20+"px";
    </script>竟然不管用,朋友说明一下,谢谢了
      

  10.   

    <script language="javascript">
    var l=document.getElementById("left").scrollHeight
    var m=document.getElementById("middle").scrollHeight
    var r=document.getElementById("right").scrollHeight
    layoutHeight=Math.max(l,m,r)
    document.getElementById("left").style.height=layoutHeight+"px"
    document.getElementById("right").style.height=layoutHeight+"px"
    document.getElementById("middle").style.height=layoutHeight+"px"
    </script>
    在给你个简单的,如果不行的话,你看下CSS里面高度是不是写死了
      

  11.   

    朋友给的那个定义function然后onload的是可以的,我就是不明白为什么定义function然后装载就行,但是直接写代码就不行了
    这个可以
    <script>
      function man_menu_height() 
    {document.getElementById("pro_man_menu").style.height=document.getElementById("pro_man_action").scrollHeight-20+"px";} 
    window.onload=man_menu_height;
      </script>
    这个不行
    <script> 
    document.getElementById("pro_man_menu").style.height=document.getElementById("pro_man_action").scrollHeight-20+"px"; 
    </script>
      

  12.   

    onload是页面加载时候就出发JS代码。直接写当然不行了,没有函数调用,最后没有onload加载