onresize检测不到啊.
例如:
<div id="dd" style="overflow:hidden;width:200;height:100;border:1px solid black;" onresize="alert('检测到了')"></div>
<input type="button" onclick="dd.innerHTML += '这是测试DDDDD'">没有反应

解决方案 »

  1.   

    晕,你的div的height,width都定义好了,你改变innerHTML没有改变height和width,当然检测不到。
      

  2.   

    希望对你有用:
    onresize:Fires when the size of the <DIV> is about to change. 层的大小改变时触发。
    onscroll:Fires when the user repositions the scroll box in the scroll bar on the <DIV>.滚动条被滑动时触发,楼主试试看。
      

  3.   

    现在我不是要检测层的大小改变,而是需要层的scrollHeight和scrollWidth这两个属性改变时,我怎样得知.onscroll只能知道scrollTop和scrollLeft的改变.
      

  4.   

    用这个比较恶心但还有效的事件吧:
    onpropertychange                    当对象的属性之一发生变化时触发的事件
      

  5.   

    可是我无法断定是哪个属性导致了onpropertychange事件呀.