Last active
October 28, 2015 09:41
-
-
Save AndyA/e6b95e7393c5ddb4dfb2 to your computer and use it in GitHub Desktop.
Show screen resolution
This file contains hidden or 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> | |
<title>How bigz dat ting</title> | |
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> | |
<script> | |
$(function() { | |
function rez() { | |
var aw = window.screen.availWidth; | |
var ah = window.screen.availHeight; | |
var w = window.screen.width; | |
var h = window.screen.height; | |
var ww = $(window).width(); | |
var wh = $(window).height(); | |
$("#output").html("width=" + w + "<br>" | |
+ "height=" + h + "<br>" | |
+ "availWidth=" + aw + "<br>" | |
+ "availHeight=" + ah + "<br>" | |
+ "windowWidth=" + ww + "<br>" | |
+ "windowHeight=" + wh); | |
} | |
rez(); | |
$(window).resize(rez); | |
}); | |
</script> | |
<style> | |
#output { | |
font-size: 2em; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="output"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment