Skip to content

Instantly share code, notes, and snippets.

@anova
Created November 12, 2015 19:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anova/00373622ae7c1ca7f085 to your computer and use it in GitHub Desktop.
Save anova/00373622ae7c1ca7f085 to your computer and use it in GitHub Desktop.
//responsive debugger
(function(){
var style_, style, div;
style_ = '';
for(var i=100; i<4000; i++){
style_ += '@media (width:' + i + 'px){ #responsive-debugger-width:after{ content:"' + i + '"}}\n';
style_ += '@media (height:' + i + 'px){ #responsive-debugger-height:after{ content:"' + i + '"}}\n';
}
style_ += '#responsive-debugger{ position: fixed; bottom:0; left:0; z-index: 9999; background-color:white; color: red; padding:10px; }';
style = document.createElement('style');
style.id = 'responsive-debugger-style';
style.innerHTML = style_;
document.body.appendChild(style);
div = document.createElement('div');
div.id = 'responsive-debugger';
div.innerHTML = '<span id="responsive-debugger-width"></span>x<span id="responsive-debugger-height"></span>';
document.body.appendChild(div);
//console.log('responsive-debugger appended');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment