maya wrote:
Cylix wrote:
>As I know, the document height is depend on browser and OS usering
using,
is there any way to get the height for that particular document
height?
I think this is what you want.....
var cw = document.body.clientWidth;
var ch = document.body.clientHeight;
That is way too simple.
From
http://www.javascripttoolbox.com/lib/util/index.php you can find this
solution:
// Get the height of the entire document
// --------------------------------------------------------------------
screen.getDocumentHeight = function() {
var body = screen.getBody();
var innerHeight =
(defined(self.innerHeight)&&!isNaN(self.innerHeigh t))?self.innerHeight:0;
if (!document.compatMode || document.compatMode=="CSS1Compat") {
var topMargin = parseInt(CSS.get(body,'marginTop'),10) || 0;
var bottomMargin = parseInt(CSS.get(body,'marginBottom'), 10) || 0;
return Math.max(body.offsetHeight + topMargin + bottomMargin,
document.documentElement.clientHeight,
document.documentElement.scrollHeight, screen.zero(self.innerHeight));
}
return Math.max(body.scrollHeight, body.clientHeight,
screen.zero(self.innerHeight));
};
--
Matt Kruse
http://www.JavascriptToolbox.com http://www.AjaxToolbox.com