[PLUG] Browser window height, javascript, jquery

Rogan Creswick creswick at gmail.com
Fri Aug 7 21:40:17 UTC 2009


On Fri, Aug 7, 2009 at 2:37 PM, Joe Pruett<joey at clean.q7.com> wrote:
>>> According to the Jquery docs at http://docs.jquery.com/CSS/height:
>>>
>>> $(window).height();   // returns height of browser viewport
>>> $(document).height(); // returns height of HTML document
>>>
>>> Is that what you're looking for?
>>
>> I do not believe this will give you the right numbers.  I get 1680x1050,
>> which is the entire width and height of my display.
>
> do you have jquery loaded?  there are two sets of raw dom values,
> inner(width/height) and out(width/height).  the inner is after
> decorations, outer is the physical browser windows.

This example seems to work well so far (tested in Opera & firefox):

http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/

--Rogan


> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>



More information about the PLUG mailing list