Obtain the Viewport Dimensions
<p>I have searched &amp; searched but I seem unable to find a way to get the viewport width &amp; height in JQuery.</p>

<p>From my attempts it seems that the following gives me the dimensions of the whole page(not the view on screen):</p>

<pre><code>$(window).width(); $(window).height();
</code></pre>

<p>Whats the way to the get the dimensions of the viewport?</p>

<p>I am attempting to determine if the user has a window smaller than 800 by 600 pixels(ie, they are on a smart phone). If they are then I position the JQuery UI Dialog within their window rather than in the center of the page/document.</p>
