Thank you, Douglas. Works like a charm! - Paul K
On Tue, May 5, 2009 at 9:19 AM, Douglas <[email protected]> wrote: > > I hope this snippet helps :o) > > > [code] > var w = 0, > h = 0; > > if (typeof(window.innerWidth) == 'number') { > w = window.innerWidth; > h = window.innerHeight; > } else if (document.documentElement && > (document.documentElement.clientWidth || > > document.documentElement.clientHeight)) > { > //IE 6+ in 'standards compliant mode' > w = document.documentElement.clientWidth; > h = document.documentElement.clientHeight; > } else if (document.body && (document.body.clientWidth || > document.body.clientHeight)) > { > //IE 4 compatible > w = document.body.clientWidth; > h = document.body.clientHeight; > } > [/code] > > > On Tue, May 5, 2009 at 1:14 PM, kimbaudi <[email protected]> wrote: > > > > Hi, I am unable to get the height of the <body> tag using > > Element.getDimensions although I can get the width of the <body> tag > > fine. How can I get the height of the <body> tag? I have my simple > > code pasted at http://pastie.org/468828. Here is the snippet of code > > below as well: > > > > function alertBodyDim() { > > /* $('main') refers to <body id="main"> */ > > var dimensions = $('main').getDimensions(); > > alert(dimensions.width); > > alert(dimensions.height); > > > > } > > > > - Paul K > > > > > > > > > -- > Believe nothing, no matter where you read it, or who said it, no > matter if I have said it, unless it agrees with your own reason and > your own common sense. ~Buddha > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---
