Skip navigation.

miscoded

the web is a hack

IE's scrollHeight logic

, , , ,

Element dimension properties is such an unstandardised mess. Do not ask me to be your guide through this maze, but below is at least some documentation of how scrollHeight behaves in IE.

If element does not have "height" specified, scrollHeight returns height of element contents + padding + border (in other words exactly what offsetHeight does).

If height is specified scrollHeight returns height of element contents + padding only.


As for Opera, we seem to have some bugs. The problem with getting it right is that the scrollHeight beast is not in any standard, so we just have to try to do "what IE does" and discover through users reporting problems out there that we actually missed out half of the logic and ended up doing something entirely different and incompatible.

This is why standards are good for you.

What Opera does: scrollHeight returns border-top-width + padding-top + height of element contents (!). How did we get there? Including only half of the border and padding width - top but not bottom values?? I don't have a clue.

spot my browser.js bugSite patching works

Comments

qicaispace 29. May 2006, 03:45

we seem to have some bugs. The problem with getting it right is that the scrollHeight beast is not in any standard,

purposeinc.com 14. January 2008, 06:53

Gratulerer med "link" en fra Matt Cutts.
Nice to meet you!
- purposeinc

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies