document.body is not the top level element.
document.documentElement is:

$(document.documentElement).getDimensions();

The fun part starts with quirks mode, when document.body acts as
document.documentElement.

You could check for such case easily:

var isBodyRoot = (function(){
  var docEl = document.documentElement;
  return !!(docEl && docEl.clientWidth == 0);
})();

It also makes sense to get Math.max of viewport and documentElement/
body values.

- kangax


On Jun 3, 11:20 am, Daniel Magliola <[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> I'm trying to get the height of the page where my script is running.
> I'm not trying to get the dimensions of the viewport, but the page. If
> the page is 1000px tall, and the viewport is 600px tall (thus, a
> scrollbar shows), i want to get "1000" independently of the position
> of the scroll.
>
> My best finding so far has been $(document.body).getDimensions()
>
> However, on IE6 it's giving me the height of the viewport.
>
> Searching for this in this forum I found some comment about quirks
> mode...
> If this is the problem, I need some kind of alternate solution. I'm
> writing a bookmarklet that's supposed to work on pretty much any page,
> so I need it to work both in quirks and standards mode.
>
> Btw, I don't NEED to use the prototype methods. Anything that'll work
> cross-browser is good for me.
>
> Thanks in Advace
> Daniel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to