Topic: HTML height (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=28116" title="Pages that link to Topic: HTML height (Page 1 of 1)" rel="nofollow" >Topic: HTML height <span class="small">(Page 1 of 1)</span>\

 
SPyX
Bipolar (III) Inmate

From: College Station, TX
Insane since: Aug 2002

posted posted 06-23-2006 02:10

Is there any javascript property that returns the height of the html page?

scrollHeight, offsetHeight, and clientHeight all return the height of the window.

-SPyX

SPyX
Bipolar (III) Inmate

From: College Station, TX
Insane since: Aug 2002

posted posted 06-23-2006 02:15

Nm it doesn't work either.

Edit: Thought I found the solution in parentNode.scrollheight but it doesn't work either.

-SPyX

(Edited by SPyX on 06-23-2006 02:30)

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 06-23-2006 02:38

http://developer.yahoo.com/yui/docs/dom/overview-summary-Dom.js.html

This is the Yahoo dom library. You can use the methods getViewPortHeight() and getViewPortWidth(), the code is right there,for the height it looks like this

code:
getViewportHeight: function() {
         var height = -1;
         var mode = document.compatMode;
      
         if ( (mode || isIE) && !isOpera ) {
            switch (mode) { // (IE, Gecko)
               case 'CSS1Compat': // Standards mode
                  height = document.documentElement.clientHeight;
                  break;
      
               default: // Quirks
                  height = document.body.clientHeight;
            }
         } else { // Safari, Opera
            height = self.innerHeight;
         }
      
         return height;
      }



Which really just breaks down to document.documentElement.clientHeight or document.body.clientHeight or self.innerHeight.

Dan @ Code Town



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu