document.clientHeight

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

    document.clientHeight

    Other than Safari 2, what other browsers that support
    document.client Height ?

    I would guess some KHTML did.

    I have found the feature, when it is present, to reliably provide the
    height of the viewport, excluding scrollbars.



  • Jorge

    #2
    Re: document.client Height

    On Sep 14, 3:27 am, dhtml <dhtmlkitc...@g mail.comwrote:
    Other than Safari 2, what other browsers that support
    document.client Height ?
    >
    I would guess some KHTML did.
    >
    I have found the feature, when it is present, to reliably provide the
    height of the viewport, excluding scrollbars.
    (element).clien tHeight
    document.**body **.clientHeight

    All the browsers support that, I think.

    site:opera.com "clientHeig ht"
    site:mozilla.or g "clientHeig ht"
    site:microsoft. com "clientHeig ht"
    site:apple.com "clientHeig ht"
    site:webkit.org clientHeight

    --
    Jorge.

    Comment

    • dhtml

      #3
      Re: document.client Height

      Jorge wrote:
      On Sep 14, 3:27 am, dhtml <dhtmlkitc...@g mail.comwrote:
      >Other than Safari 2, what other browsers that support
      >document.clien tHeight ?
      >>
      >I would guess some KHTML did.
      >>
      >I have found the feature, when it is present, to reliably provide the
      >height of the viewport, excluding scrollbars.
      >
      (element).clien tHeight
      document.**body **.clientHeight
      >
      All the browsers support that, I think.
      >
      Most browsers support (element).clien tHeight. But document is not an
      element. Not all browsers support document.client Height.

      >
      --
      Jorge.

      Comment

      • Jorge

        #4
        Re: document.client Height

        On Sep 14, 5:53 pm, dhtml <dhtmlkitc...@g mail.comwrote:
        >
        Most browsers support (element).clien tHeight. But document is not an
        element. Not all browsers support document.client Height.
        >
        javascript:aler t(document.clie ntHeight)

        In a Mac: Opera 9.5x, FF2&3, Safari 3&4, Camino, IE5.23, NS9, iCab3 --
        undefined.
        --
        Jorge.

        Comment

        • Arun

          #5
          Re: document.client Height

          On Sep 14, 5:53 pm, Jorge wrote:
          On Sep 14, 5:53 pm, dhtml wrote:
          Most browsers support (element).clien tHeight. But document is not an
          element. Not all browsers support document.client Height.
          >
          javascript:aler t(document.clie ntHeight)
          >
          In a Mac: Opera 9.5x, FF2&3, Safari 3&4, Camino, IE5.23, NS9, iCab3 --
          >
          undefined.
          document.client Height is not widely supported (actually browsers that
          support it are deprecating its functionality) and it is recommended to
          use document.body.c lientHeight which is supported in all browsers.

          document.client Height, in fact, doesn't make any sense as document is
          not an element and merely a placeholder for the DOM tree returned from
          the underlying markup and is invisible to one's eyes. You don't have
          heights for objects that are not even visible.

          ;) Cheers,
          Arun

          Comment

          • Andrew Poulos

            #6
            Re: document.client Height

            Arun wrote:
            On Sep 14, 5:53 pm, Jorge wrote:
            >On Sep 14, 5:53 pm, dhtml wrote:
            >>Most browsers support (element).clien tHeight. But document is not an
            >>element. Not all browsers support document.client Height.
            >javascript:ale rt(document.cli entHeight)
            >>
            >In a Mac: Opera 9.5x, FF2&3, Safari 3&4, Camino, IE5.23, NS9, iCab3 --
            >>
            >>undefined.
            >
            document.client Height is not widely supported (actually browsers that
            support it are deprecating its functionality) and it is recommended to
            use document.body.c lientHeight which is supported in all browsers.
            >
            document.client Height, in fact, doesn't make any sense as document is
            not an element and merely a placeholder for the DOM tree returned from
            the underlying markup and is invisible to one's eyes. You don't have
            heights for objects that are not even visible.
            >
            Doesn't IE 6, in strict mode, use document.docume ntElement.clien tHeight?

            Andrew Poulos

            Comment

            • Henry

              #7
              Re: document.client Height

              On Sep 15, 2:18 pm, Andrew Poulos wrote:
              Arun wrote:
              <snip>
              >... and it is recommended to use document.body.c lientHeight
              >which is supported in all browsers.
              <snip>
              Doesn't IE 6, in strict mode, use
              document.docume ntElement.clien tHeight?
              It would be better to call it "standards" , "CSS" or "CSS1Compat " mode
              (the first being normal and the last the internal name
              (document.compa tMode)) and its opposite something like "quirks" or
              "BackCompat " mode. Referring to it as "strict" tends to encourage the
              misconception that it has some relationship with the distinction
              between "strict" and "transition al" in HTML (and when ECMAScript
              introduces a "strict" mode (in the next version) there would be
              additional confusion).

              But yes, when (document.compa tMode == 'CSS1Compat') IE 6 client
              dimensions are to be found on the documentElement not the body (and
              the values read from the body element will be very wrong). But this is
              not necessarily true of other browsers that expose a -
              document.compat Mode - property.

              Comment

              • dhtml

                #8
                Re: document.client Height

                Arun wrote:
                On Sep 14, 5:53 pm, Jorge wrote:
                >On Sep 14, 5:53 pm, dhtml wrote:
                >>Most browsers support (element).clien tHeight. But document is not an
                >>element. Not all browsers support document.client Height.
                >javascript:ale rt(document.cli entHeight)
                >>
                >In a Mac: Opera 9.5x, FF2&3, Safari 3&4, Camino, IE5.23, NS9, iCab3 --
                >>
                >>undefined.
                >
                document.client Height is not widely supported (actually browsers that
                support it are deprecating its functionality) and it is recommended to
                use document.body.c lientHeight which is supported in all browsers.
                >
                It was removed from Safari. Safari 2.0.4 had it. Not sure which other
                browsers have it (probably some KHTML). Seems to be quite rare.



                document.client Height, in fact, doesn't make any sense as document is
                not an element and merely a placeholder for the DOM tree returned from
                the underlying markup and is invisible to one's eyes. You don't have
                heights for objects that are not even visible.
                >

                It could be argued that documentElement .clientHeight returning the
                height of the viewport (sans horz scrollbar) makes less sense. It is
                ambiguous and doesn't work that way in all browsers.

                Should clientHeight return the cleintHeight of the element? That's what
                recent past versions of Opera do. What should
                documentElement .scrollHeight return? Should it return the scrollHeight
                of the html element or the height of the viewport? What about
                documentElement .clientTop, or offsetTop?

                The viewport is not the documentElement . There's a lot of special
                treatment given to the root node for functionality of the viewport. Even
                body gets some special treatment, too (overflow, background, event
                handlers).

                Garrett
                ;) Cheers,
                Arun
                >

                Comment

                • dhtml

                  #9
                  Re: document.client Height

                  dhtml wrote:
                  Arun wrote:
                  >On Sep 14, 5:53 pm, Jorge wrote:
                  >>On Sep 14, 5:53 pm, dhtml wrote:
                  >>>Most browsers support (element).clien tHeight. But document is not an
                  >>>element. Not all browsers support document.client Height.
                  >>javascript:al ert(document.cl ientHeight)
                  >>>
                  >>In a Mac: Opera 9.5x, FF2&3, Safari 3&4, Camino, IE5.23, NS9, iCab3 --
                  >>>
                  >>>undefined.
                  >>
                  >document.clien tHeight is not widely supported (actually browsers that
                  >support it are deprecating its functionality) and it is recommended to
                  >use document.body.c lientHeight which is supported in all browsers.
                  >>
                  >
                  It was removed from Safari. Safari 2.0.4 had it. Not sure which other
                  browsers have it (probably some KHTML). Seems to be quite rare.
                  >
                  >
                  >
                  >
                  >document.clien tHeight, in fact, doesn't make any sense as document is
                  >not an element and merely a placeholder for the DOM tree returned from
                  >the underlying markup and is invisible to one's eyes. You don't have
                  >heights for objects that are not even visible.
                  >>
                  >
                  >
                  It could be argued that documentElement .clientHeight returning the
                  height of the viewport (sans horz scrollbar) makes less sense. It is
                  ambiguous and doesn't work that way in all browsers.
                  >
                  Should clientHeight return the cleintHeight of the element? That's what
                  recent past versions of Opera do. What should
                  documentElement .scrollHeight return? Should it return the scrollHeight
                  of the html element or the height of the viewport?
                  (I meant "document's scrollable area").......^^ ^

                  What about
                  documentElement .clientTop, or offsetTop?
                  >
                  The viewport is not the documentElement . There's a lot of special
                  treatment given to the root node for functionality of the viewport. Even
                  body gets some special treatment, too (overflow, background, event
                  handlers).
                  >
                  Garrett
                  >
                  >;) Cheers,
                  >Arun
                  >>

                  Comment

                  Working...