You are in a quirks mode.
That's why document.body acts as a document.
Add a proper doctype and it should work as expected.
Best,
kangax
On May 8, 5:42 pm, blechler <[EMAIL PROTECTED]> wrote:
> If I change init to:
>
> function init() {
> if (navigator.appName == "Microsoft Internet Explorer"){
> alert(document.body.offsetHeight);
> } else {
> alert(window.innerHeight);
> }
>
> }
>
> I do get the height of the viewport.
>
> document.viewport.getHeight() seems to tell me the height of the
> content within the viewport.
>
> B
>
> On May 8, 5:08 pm, "Justin Perkins" <[EMAIL PROTECTED]> wrote:
>
> > > alert(document.viewport.getHeight());
> > > --------------------------------------------------------
> > > In FF the alert says 8, and in IE 6 & 7 I get 0. Isn't this supposed
> > > to return the height of the viewable area?
>
> > To get the full height of the window, including scrollable space, I've
> > always used document.body.getDimensions().height or
> > document.body.getHeight(). If you want just the height of the viewable
> > area, you can use document.viewport.getDimensions().height or
> > document.viewport.getHeight().
>
> >http://prototypejs.org/api/document/viewport
>
> > document.body does not seem to be mentioned in the Prototype API docs,
> > but it is just a regular Prototype extended element so all the methods
> > that you can do on any other DOM element can also be done on
> > document.body.
>
> > -justin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---