Skip to content Skip to sidebar Skip to footer

Making Dom Ie Friendly

How can I make this script IE friendly? The only parts that aren't IE friendly are the variables scrolledtonum and heightofbody... function getheight() { var myWidth =

Solution 1:

The mozilla MDN documentation for scrollY contains sample code for dealing with compatibility issues with pageYOffset: https://developer.mozilla.org/En/DOM/Window.scrollY.

It says the following:

For cross-browser compatibility, use window.pageYOffset instead of window.scrollY, except use

(((t = document.documentElement) || (t = document.body.parentNode)) && typeof t.ScrollTop == 'number' ? t : document.body).ScrollTop

when window.pageYOffset (and window.scrollY) is undefined.

Post a Comment for "Making Dom Ie Friendly"