<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Get document height (cross-browser)</title>
	<atom:link href="http://james.padolsey.com/javascript/get-document-height-cross-browser/feed/" rel="self" type="application/rss+xml" />
	<link>http://james.padolsey.com/javascript/get-document-height-cross-browser/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 02 Sep 2010 20:23:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: CrAcKoFdAwN</title>
		<link>http://james.padolsey.com/javascript/get-document-height-cross-browser/comment-page-1/#comment-24627</link>
		<dc:creator>CrAcKoFdAwN</dc:creator>
		<pubDate>Thu, 19 Nov 2009 23:17:29 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=370#comment-24627</guid>
		<description>Hi,
thx for this script! It works perfectly with IE 8 and Opera 10, but not with Firefox 3.5. It returns a height of about 30 pixels, even though the document&#039;s height is 1000+ pixel.
Any idea?</description>
		<content:encoded><![CDATA[<p>Hi,<br />
thx for this script! It works perfectly with IE 8 and Opera 10, but not with Firefox 3.5. It returns a height of about 30 pixels, even though the document&#8217;s height is 1000+ pixel.<br />
Any idea?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RP</title>
		<link>http://james.padolsey.com/javascript/get-document-height-cross-browser/comment-page-1/#comment-12680</link>
		<dc:creator>RP</dc:creator>
		<pubDate>Sun, 24 May 2009 20:54:44 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=370#comment-12680</guid>
		<description>Thank you for posting this.  Surely solves a lot of my presentation issues being able to resize the containers dynamically based on content.</description>
		<content:encoded><![CDATA[<p>Thank you for posting this.  Surely solves a lot of my presentation issues being able to resize the containers dynamically based on content.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Schend</title>
		<link>http://james.padolsey.com/javascript/get-document-height-cross-browser/comment-page-1/#comment-11905</link>
		<dc:creator>James Schend</dc:creator>
		<pubDate>Fri, 15 May 2009 18:26:02 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=370#comment-11905</guid>
		<description>You can pass as many values as you want into Math.max(). Try this:

&lt;pre lang=&quot;javascript&quot;&gt;var db = document.body;
var dde = document.documentElement;

var docHeight = Math.max(db.scrollHeight, dde.scrollHeight, db.offsetHeight, dde.offsetHeight, db.clientHeight, dde.clientHeight)&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>You can pass as many values as you want into Math.max(). Try this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span class="kw2">var</span> db <span class="sy0">=</span> document.<span class="me1">body</span><span class="sy0">;</span>
<span class="kw2">var</span> dde <span class="sy0">=</span> document.<span class="me1">documentElement</span><span class="sy0">;</span>
&nbsp;
<span class="kw2">var</span> docHeight <span class="sy0">=</span> Math.<span class="me1">max</span><span class="br0">&#40;</span>db.<span class="me1">scrollHeight</span><span class="sy0">,</span> dde.<span class="me1">scrollHeight</span><span class="sy0">,</span> db.<span class="me1">offsetHeight</span><span class="sy0">,</span> dde.<span class="me1">offsetHeight</span><span class="sy0">,</span> db.<span class="me1">clientHeight</span><span class="sy0">,</span> dde.<span class="me1">clientHeight</span><span class="br0">&#41;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Harris</title>
		<link>http://james.padolsey.com/javascript/get-document-height-cross-browser/comment-page-1/#comment-8333</link>
		<dc:creator>Richard Harris</dc:creator>
		<pubDate>Sat, 21 Mar 2009 19:30:30 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=370#comment-8333</guid>
		<description>Great piece of code James - nice,simple and comprehensive. Thanks and loving your work!

Any reason you didn&#039;t use &#039;document.height&#039; tho?</description>
		<content:encoded><![CDATA[<p>Great piece of code James &#8211; nice,simple and comprehensive. Thanks and loving your work!</p>
<p>Any reason you didn&#8217;t use &#8216;document.height&#8217; tho?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Walker</title>
		<link>http://james.padolsey.com/javascript/get-document-height-cross-browser/comment-page-1/#comment-5776</link>
		<dc:creator>Ben Walker</dc:creator>
		<pubDate>Thu, 19 Feb 2009 12:24:58 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=370#comment-5776</guid>
		<description>Thanks, James. That&#039;s a wonderfully helpful little snippet (especially in jQuery). It just solved an IE6 jqModal overlay nightmare for me.

;)</description>
		<content:encoded><![CDATA[<p>Thanks, James. That&#8217;s a wonderfully helpful little snippet (especially in jQuery). It just solved an IE6 jqModal overlay nightmare for me.</p>
<p> <img src='http://james.padolsey.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Razvan</title>
		<link>http://james.padolsey.com/javascript/get-document-height-cross-browser/comment-page-1/#comment-4989</link>
		<dc:creator>Razvan</dc:creator>
		<pubDate>Wed, 11 Feb 2009 14:54:58 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=370#comment-4989</guid>
		<description>Excellent !!! I call the function at the end of my html script and it works just fine. I have successfully tested also on Netscape 9 (Mozilla 5.0), even if I know it is at the end of his life.</description>
		<content:encoded><![CDATA[<p>Excellent !!! I call the function at the end of my html script and it works just fine. I have successfully tested also on Netscape 9 (Mozilla 5.0), even if I know it is at the end of his life.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: casper</title>
		<link>http://james.padolsey.com/javascript/get-document-height-cross-browser/comment-page-1/#comment-4307</link>
		<dc:creator>casper</dc:creator>
		<pubDate>Wed, 04 Feb 2009 14:46:50 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=370#comment-4307</guid>
		<description>Excellent!!</description>
		<content:encoded><![CDATA[<p>Excellent!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dylan</title>
		<link>http://james.padolsey.com/javascript/get-document-height-cross-browser/comment-page-1/#comment-3021</link>
		<dc:creator>Dylan</dc:creator>
		<pubDate>Wed, 14 Jan 2009 16:40:17 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=370#comment-3021</guid>
		<description>Any ideas how to get this into the css without flickering... (I believe the height is only known after the page has loaded)..

Nice code though, compliments, greets, Dylan</description>
		<content:encoded><![CDATA[<p>Any ideas how to get this into the css without flickering&#8230; (I believe the height is only known after the page has loaded)..</p>
<p>Nice code though, compliments, greets, Dylan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://james.padolsey.com/javascript/get-document-height-cross-browser/comment-page-1/#comment-2487</link>
		<dc:creator>James</dc:creator>
		<pubDate>Tue, 06 Jan 2009 19:18:10 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=370#comment-2487</guid>
		<description>Actually in jQuery it&#039;s a bit easier because it does most of the work for us:

&lt;pre lang=&quot;javascript&quot;&gt;
$.getDocHeight = function(){
    return Math.max(
        $(document).height(),
        $(window).height(),
        /* For opera: */
        document.documentElement.clientHeight
    );
};
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Actually in jQuery it&#8217;s a bit easier because it does most of the work for us:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$.<span class="me1">getDocHeight</span> <span class="sy0">=</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
    <span class="kw1">return</span> Math.<span class="me1">max</span><span class="br0">&#40;</span>
        $<span class="br0">&#40;</span>document<span class="br0">&#41;</span>.<span class="me1">height</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">,</span>
        $<span class="br0">&#40;</span>window<span class="br0">&#41;</span>.<span class="me1">height</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">,</span>
        <span class="co2">/* For opera: */</span>
        document.<span class="me1">documentElement</span>.<span class="me1">clientHeight</span>
    <span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="sy0">;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Joe McCann</title>
		<link>http://james.padolsey.com/javascript/get-document-height-cross-browser/comment-page-1/#comment-2472</link>
		<dc:creator>Joe McCann</dc:creator>
		<pubDate>Tue, 06 Jan 2009 15:27:40 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=370#comment-2472</guid>
		<description>And for us jQuery junkies:

&lt;pre lang=&quot;javascript&quot;&gt;
$.getDocHeight = function(){
     var D = document;
     return Math.max(Math.max(D.body.scrollHeight,    D.documentElement.scrollHeight), Math.max(D.body.offsetHeight, D.documentElement.offsetHeight), Math.max(D.body.clientHeight, D.documentElement.clientHeight));
};

alert( $.getDocHeight() );
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>And for us jQuery junkies:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$.<span class="me1">getDocHeight</span> <span class="sy0">=</span> <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span>
     <span class="kw2">var</span> D <span class="sy0">=</span> document<span class="sy0">;</span>
     <span class="kw1">return</span> Math.<span class="me1">max</span><span class="br0">&#40;</span>Math.<span class="me1">max</span><span class="br0">&#40;</span>D.<span class="me1">body</span>.<span class="me1">scrollHeight</span><span class="sy0">,</span>    D.<span class="me1">documentElement</span>.<span class="me1">scrollHeight</span><span class="br0">&#41;</span><span class="sy0">,</span> Math.<span class="me1">max</span><span class="br0">&#40;</span>D.<span class="me1">body</span>.<span class="me1">offsetHeight</span><span class="sy0">,</span> D.<span class="me1">documentElement</span>.<span class="me1">offsetHeight</span><span class="br0">&#41;</span><span class="sy0">,</span> Math.<span class="me1">max</span><span class="br0">&#40;</span>D.<span class="me1">body</span>.<span class="me1">clientHeight</span><span class="sy0">,</span> D.<span class="me1">documentElement</span>.<span class="me1">clientHeight</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="sy0">;</span>
&nbsp;
<span class="kw3">alert</span><span class="br0">&#40;</span> $.<span class="me1">getDocHeight</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>

]]></content:encoded>
	</item>
</channel>
</rss>
