Trying to retrieve pageOffSet

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Billy

    #1

    Trying to retrieve pageOffSet

    Hi,

    I'm trying to get the x and y cords for a window using "pageXOffSe t" and
    "pageYOffSe t" but all it returns is "undefined" . Is this old syntax? How
    do I do this?
    Thanks,
    Billy


  • Billy

    #2
    Re: Trying to retrieve pageOffSet

    > I'm trying to get the x and y cords for a window using "pageXOffSe t" and[color=blue]
    > "pageYOffSe t" but all it returns is "undefined" . Is this old syntax? How
    > do I do this?[/color]

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

    Billy


    Comment

    • DU

      #3
      Re: Trying to retrieve pageOffSet

      Billy wrote:
      [color=blue]
      > Hi,
      >
      > I'm trying to get the x and y cords for a window using "pageXOffSe t" and
      > "pageYOffSe t" but all it returns is "undefined" .[/color]

      That's one good example of relying on detection of method/property
      support instead of user agent string detection.

      Is this old syntax? How[color=blue]
      > do I do this?
      > Thanks,
      > Billy
      >
      >[/color]

      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.docume ntElement.scrol lLeft and document.docume ntElement.scrol lTop
      for MSIE 6 in standards compliant rendering mode.
      You must use
      document.body.s crollLeft and document.body.s crollTop
      for MSIE 6 in backward compatible rendering mode and for MSIE 5.

      DU

      Comment

      Working...