Loading ...
Sorry, an error occurred while loading the content.
 

YAHOO.util.Dom - Tools to get page scroll ?

Expand Messages
  • wildmanwalsh
    New to the YAHOO UI toolsets, and have been trying to find a way to find the current page scroll? The getViewportWidth(), etc tools are fantastic, but I seem
    Message 1 of 3 , Jul 31, 2006
      New to the YAHOO UI toolsets, and have been trying to find a way to
      find the current page scroll? The getViewportWidth(), etc tools are
      fantastic, but I seem unable to find a method of finding the scroll.

      Any help appreciated.
    • Matt Sweeney
      There is currently no tool for this, but if there were, they would probably look something like: YAHOO.util.Dom.getWindowScrollX = function() { return
      Message 2 of 3 , Jul 31, 2006
        There is currently no tool for this, but if there were, they would
        probably look something like:

        YAHOO.util.Dom.getWindowScrollX = function() {
        return Math.max(document.documentElement.scrollLeft,
        document.body.scrollLeft);
        };

        YAHOO.util.Dom.getWindowScrollY = function() {
        return Math.max(document.documentElement.scrollTop,
        document.body.scrollTop);
        };

        (using Math.max() to ensure accuracy between rendering modes)

        Matt

        wildmanwalsh wrote:

        >New to the YAHOO UI toolsets, and have been trying to find a way to
        >find the current page scroll? The getViewportWidth(), etc tools are
        >fantastic, but I seem unable to find a method of finding the scroll.
        >
        >Any help appreciated.
        >
        >
        >
        >
        >
        >
        >
        >Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
      • wildmanwalsh
        Thanks for that, I did not think there was existing methods to handle this as I could not locate them in the scripts. I have a nice set of methods of my own to
        Message 3 of 3 , Aug 1, 2006
          Thanks for that, I did not think there was existing methods to handle
          this as I could not locate them in the scripts.

          I have a nice set of methods of my own to handle these, so I will
          continue to use those.

          Cheers.


          --- In ydn-javascript@yahoogroups.com, Matt Sweeney <msweeney@...>
          wrote:
          >
          > There is currently no tool for this, but if there were, they would
          > probably look something like:
          >
          > YAHOO.util.Dom.getWindowScrollX = function() {
          > return Math.max(document.documentElement.scrollLeft,
          > document.body.scrollLeft);
          > };
          >
          > YAHOO.util.Dom.getWindowScrollY = function() {
          > return Math.max(document.documentElement.scrollTop,
          > document.body.scrollTop);
          > };
          >
          > (using Math.max() to ensure accuracy between rendering modes)
          >
          > Matt
        Your message has been successfully submitted and would be delivered to recipients shortly.