Skip to content

Instantly share code, notes, and snippets.

@Error-331
Created May 2, 2012 11:42
Show Gist options
  • Save Error-331/2576009 to your computer and use it in GitHub Desktop.
Save Error-331/2576009 to your computer and use it in GitHub Desktop.
JavaScript note
Compatibility
=============
scrollWidth and scrollHeight
----------------------------
Not proper in IE 5.5, 6, 7 (http://www.quirksmode.org/dom/w3c_cssom.html), use something like this:
if (navigator.appName == 'Microsoft Internet Explorer' && (document.compatMode == undefined || document.compatMode != 'CSS1Compat'))
{
this.WinHeight = Math.max(document.body.scrollHeight, document.body.clientHeight) + 'px';
this.IsQuirks = true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment