viewportSize

example

A cross browser way to obtain the CSS viewport size using JavaScript. Resize your viewport and toggle the scroll bars to see it work.

Toggle Scroll Bars
viewportSize.getWidth() = Requires JavaScript
window.innerWidth = Requires JavaScript
documentElement.clientWidth = Requires JavaScript
viewportSize.getHeight() = Requires JavaScript
window.innerHeight = Requires JavaScript
documentElement.clientHeight = Requires JavaScript

Code sample

<script type="text/javascript"> var width = viewportSize.getWidth(); var height = viewportSize.getHeight(); </script>

Need more info? View the project
Author: Tyson Matanich