469,890 Members | 2,154 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,890 developers. It's quick & easy.

Trying to retrieve pageOffSet

Hi,

I'm trying to get the x and y cords for a window using "pageXOffSet" and
"pageYOffSet" but all it returns is "undefined". Is this old syntax? How
do I do this?
Thanks,
Billy
Jul 20 '05 #1
2 2871
> I'm trying to get the x and y cords for a window using "pageXOffSet" and
"pageYOffSet" but all it returns is "undefined". Is this old syntax? How
do I do this?


Maybe I should add that I'm trying to retrieve the position of the window
(where it has been scrolled to).

Billy
Jul 20 '05 #2
DU
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
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Ed_P. | last post: by
12 posts views Thread by Phil Certain | last post: by
2 posts views Thread by Andrew | last post: by
4 posts views Thread by freefly_xml | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.