Created
October 26, 2017 17:07
-
-
Save tlinkner/058f31484ed817a3fe739f76b7d2955a to your computer and use it in GitHub Desktop.
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
/* Debug: Tell Size | |
=========================================================== | |
Show browser size. Turn off on production. | |
*/ | |
(function () { | |
var ts = document.createElement('div'); | |
ts.setAttribute("id", "msg"); | |
ts.style.cssText = "padding:0.25em;position:fixed;bottom:0;right:0;font-size:0.75em;font-weight:bold;color:white;background:red;"; | |
document.body.appendChild(ts); | |
function tellSize() { | |
ts.innerHTML = window.innerWidth + "px x " + window.innerHeight + "px" | |
+ "<br>" + (window.innerWidth/16) + "em x " + (window.innerHeight/16) + "em"; | |
} | |
window.onload = tellSize; | |
window.onresize = tellSize; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment