Created
September 18, 2012 15:30
-
-
Save stvedt/3743770 to your computer and use it in GitHub Desktop.
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>Accurate Viewport with jQuery</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
var viewPort = $(window); | |
viewPort.resize(function(){ | |
console.log('height: ' + viewPort.height()); | |
console.log('width: ' + viewPort.width()); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<p>Lorem ipsum delorem amet.</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment