[Prototype-core] Help! How to get document.body height using Element.getDimensions

2009-05-05 Thread kimbaudi

Hi, I am unable to get the height of the  tag using
Element.getDimensions although I can get the width of the  tag
fine. How can I get the height of the  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  */
var dimensions = $('main').getDimensions();
alert(dimensions.width);
alert(dimensions.height);
}

- Paul K
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Help! How to get document.body height using Element.getDimensions

2009-05-05 Thread Yaoxing Zhang
I think what you want is not the height of body, but client height. try:
document.documentElement.clientHeight;

On Wed, May 6, 2009 at 12:09 AM, kimbaudi  wrote:

>
> Hi, I am unable to get the height of the  tag using
> Element.getDimensions although I can get the width of the  tag
> fine. How can I get the height of the  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  */
>var dimensions = $('main').getDimensions();
>alert(dimensions.width);
>alert(dimensions.height);
> }
>
> - Paul K
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---



[Prototype-core] Re: Help! How to get document.body height using Element.getDimensions

2009-05-05 Thread Paul Kim
Hi, I was able to determine the body height by window.innerHeight,
document.documentElement.clientHeight, or document.body.clientHeight
depending on the browser. Thanks!

- Paul K

On Tue, May 5, 2009 at 10:32 AM, Yaoxing Zhang wrote:

> I think what you want is not the height of body, but client height. try:
> document.documentElement.clientHeight;
>
> On Wed, May 6, 2009 at 12:09 AM, kimbaudi  wrote:
>
>>
>> Hi, I am unable to get the height of the  tag using
>> Element.getDimensions although I can get the width of the  tag
>> fine. How can I get the height of the  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  */
>>var dimensions = $('main').getDimensions();
>>alert(dimensions.width);
>>alert(dimensions.height);
>> }
>>
>> - Paul K
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~--~~~~--~~--~--~---