Re: <body>.getBoundingClientRect()

Martijn <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
On Tue, Jun 24, 2008 at 12:29 AM, Jonas Sicking <[email protected]> wrote:
> Techincally speaking the page doesn't have a height of 0px, but the
> <body> element does.
>
> I don't know if there is a way to get the size of the whole page through
> the DOM.

Yes, there is, using window.innerHeight + window.scrollMaxY.
See http://developer.mozilla.org/en/docs/DOM:window.scrollMaxY

Regards,
Martijn

> / Jonas
>
> Martijn wrote:
>> Well, that page does have a height of 0px, as I can see with the DOM inspector.
>> All the direct children of the body are floating elements.
>>
>> Regards,
>> Martijn
>>
>> On Sun, Jun 22, 2008 at 4:19 AM, Kenny Kai Yin Yu
>> <[email protected]> wrote:
>>> Hmm, for example, when i do it in www.reuters.com ...
>>>
>>> On Sun, Jun 22, 2008 at 2:27 AM, Martijn <[email protected]> wrote:
>>>> On Sat, Jun 21, 2008 at 7:58 PM, Kenny YU <[email protected]> wrote:
>>>>> hi, got a question here: I supposed <body>.getBoundingClientRect()
>>>>> should return the rectangle of the whole document. but sometimes it
>>>>> returns a rectangle of 0 height. why is that?
>>>> Kenny, in what case does it return a rectangle of 0 height?
>>>>
>>>> Regards,
>>>> Martij
>>>>> Thanks
>>>>> _______________________________________________
>>>>> dev-tech-dom mailing list
>>>>> [email protected]
>>>>> https://lists.mozilla.org/listinfo/dev-tech-dom
>>>>>
>>>>
>>>>
>>>> --
>>>> Martijn Wargers - Help Mozilla!
>>>> http://weblogs.mozillazine.org/qa/
>>>> http://wiki.mozilla.org/Mozilla_QA_Community
>>>> irc://irc.mozilla.org/qa - /nick mw22
>>>
>>
>>
>>
> _______________________________________________
> dev-tech-dom mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-tech-dom
>



-- 
Martijn Wargers - Help Mozilla!
http://weblogs.mozillazine.org/qa/
http://wiki.mozilla.org/Mozilla_QA_Community
irc://irc.mozilla.org/qa - /nick mw22
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.