Billy wrote:
Hi,
I'm trying to get the x and y cords for a window using "pageXOffSet" and
"pageYOffSet" but all it returns is "undefined".
That's one good example of relying on detection of method/property
support instead of user agent string detection.
Is this old syntax? How do I do this?
Thanks,
Billy
These are supported by Mozilla-based browsers, Safari 1.x and Opera 7.x;
they are not supported by MSIE 5+.
You must use
document.documentElement.scrollLeft and document.documentElement.scrollTop
for MSIE 6 in standards compliant rendering mode.
You must use
document.body.scrollLeft and document.body.scrollTop
for MSIE 6 in backward compatible rendering mode and for MSIE 5.
DU