If you are using this repo it will no longer be maintained, please instead use viewportSize which also allows you to get the viewport height.
- Author: Tyson Matanich - http://matanich.com
- License: MIT
Size and delivery
getViewportWidth.js compresses to around 541 bytes (~0.5 KB), after minify and gzip. To minify, you might try these online tools: [Microsoft Ajax Minifier]:(http://ajaxmin.codeplex.com/), [Uglify]:(http://marijnhaverbeke.nl/uglifyjs), [Yahoo Compressor]:(http://refresh-sf.com/yui/), or Closure Compiler. Serve with gzip compression.
GetViewportWidth supports a broad range of browsers and devices (there are currently no known unsupported browsers).