scrollHeight in IE7 returns incorrect value unless specifically referenced before used

后端 未结 1 1447
栀梦
栀梦 2021-01-14 14:32

I have been working on an Accordion class for MooTools that is more catered to what I need, but have noticed that in IE7 (which I still need to support), element.scrollHeigh

1条回答
  •  终归单人心
    2021-01-14 14:57

    See this table.

    When the element has no scrollbars IE makes the scrollHeight equal to the actual height of the content; and not the height of the element. scrollWidth is correct, except in IE8, where it’s 5 pixels off.

    And scrollHeight marked as 'incorrect' for ie5-7. Maybe it will work with offsetHeight? Or calculate it somehow from other properties?

    Also here mentioned that...

    Whatever you do, in IE access the propertys not before body's onload has fired, otherwise you will get weird results.

    0 讨论(0)
提交回复
热议问题