Created
April 27, 2014 12:54
-
-
Save bezenson/11344917 to your computer and use it in GitHub Desktop.
Get Viewport Width
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function viewportWidth() { | |
var $body = $('body'), | |
viewPortWidth = $body.css('overflow', 'hidden').width(); | |
$body.css('overflow', ''); | |
return viewPortWidth; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment