Skip to content

Instantly share code, notes, and snippets.

@Fabryz
Created February 27, 2012 15:26
Show Gist options
  • Save Fabryz/1924649 to your computer and use it in GitHub Desktop.
Save Fabryz/1924649 to your computer and use it in GitHub Desktop.
Calderan's Resolutions
javascript:(function(){var a=document.createElement("script");a.src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js";a.onload=a.onreadystatechange=function(){$("<div/>",{html:"Resize window",id:"debug"}).appendTo("body");var a=$("#debug");a.css({"z-index":"9999",position:"absolute",top:"5px",right:"5px",padding:"5px",border:"2px #d8d8dc solid",color:"#2068a5",font:"16px Arial, sans-serif","font-weight":"bold",background:"rgba(220,220,220,.85)"});$(window).resize(function(){var b=Math.floor($(window).width()),c=Math.floor($(window).height());a.html(b+"x"+c)})};document.body.appendChild(a)})();
(function() {
var script = document.createElement("script");
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js";
script.onload = script.onreadystatechange = function(){
$("<div/>", {
html: "Resize window",
id: "debug"
}).appendTo("body");
var debug = $("#debug");
debug.css({
"z-index": "9999",
"position": "absolute",
"top": "5px",
"right": "5px",
"padding": "5px",
"border": "2px #d8d8dc solid",
"color": "#2068a5",
"font": "16px Arial, sans-serif",
"font-weight": "bold",
"background": "rgba(220,220,220,.85)",
});
$(window).resize(function() {
var width = Math.floor($(window).width()),
height = Math.floor($(window).height());
debug.html(width +"x"+ height);
});
};
document.body.appendChild( script );
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment