Skip to content

Instantly share code, notes, and snippets.

@justmarkup
Created February 27, 2012 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justmarkup/1927847 to your computer and use it in GitHub Desktop.
Save justmarkup/1927847 to your computer and use it in GitHub Desktop.
simple script for showing current screen width so you know where to set a breakpoint in your design
var developissimo = function() {
var devcon = document.createElement('div'),
devstyle = document.createElement('style');
devcon.id = 'developissimo';
devstyle.innerHTML = '#developissimo{position:absolute;top:0;right:0;z-index: 10000;padding:5px;background:#fff}';
document.head.appendChild(devstyle);
devcon.innerHTML = window.innerWidth;
document.body.appendChild(devcon);
window.onresize = resize;
function resize () {
console.log('resize');
devcon.innerHTML = window.innerWidth;
}
};
developissimo();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment