A cross browser way to obtain the CSS viewport size using JavaScript. Resize your viewport and toggle the scroll bars to see it work.
<script type="text/javascript">
var width = viewportSize.getWidth();
var height = viewportSize.getHeight();
</script>
Need more info? View the project
Author: Tyson Matanich