Topic: HTML height Pages that link to <a href="https://ozoneasylum.com/backlink?for=28116" title="Pages that link to Topic: HTML height" rel="nofollow" >Topic: HTML height\

 
Author Thread
SPyX
Bipolar (III) Inmate

From: College Station, TX
Insane since: Aug 2002

IP logged posted posted 06-23-2006 02:10 Edit Quote

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

IP logged posted posted 06-23-2006 02:15 Edit Quote

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

IP logged posted posted 06-23-2006 02:38 Edit Quote

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