The correct syntax, from 1.6 onwards for the dimensions of the
viewport (I suppose that''s what you mean by window) is:
document.viewport.getHeight() //-> int
document.viewport.getWidth() //-> int
document.viewport.getDimensions() //-> {width: int, height: int}
regards,
Tobie
On Oct 10, 1:45 am, Alex Duffield
<A...-GLL9njBnHiGqPKKiFzS5XxZCeNDtXRbv@public.gmane.org>
wrote:> I need to get the height of the window, so I tried
>
> document.body.getHeight(), but it always returns 0 (on Firefox and
> Safari)
>
> I also tryed
>
> document.body.getDimentions().height and again I get 0
>
> but
> document.body.getDimentions().width gives me the correct window width...
>
> Any ideas what I am doing wrong here???
>
> ______________________________________________________________________
> Alex Duffield ❖ Principal ❖ InControl Solutions .
http://www.incontrolsolutions.com
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---