Created
January 10, 2015 13:23
-
-
Save joebillings/475dd0c175e760bd4128 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
javascript:(function() { | |
var d = document, | |
w = window, | |
sw = function() { return Math.max(d.documentElement.clientWidth, w.innerWidth) }, | |
i = d.createElement("div"), | |
s = "position:fixed;top:0;right:0;padding:4px 6px;z-index:999999;opacity:.8;background:#000;color:#fff;font:15px HelveticaNeue"; | |
i.setAttribute("style", s); | |
i.innerHTML = sw() + "px"; | |
d.querySelector("body").appendChild(i); | |
if (w.addEventListener) | |
w.addEventListener("resize", function() { go(sw) }); | |
else if (w.attachEvent) | |
w.attachEvent("onresize", function() { go(sw) }); | |
else | |
w.onresize = function() { go(sw) }; | |
function go() { | |
i.innerHTML = sw() + "px"; | |
} | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment