Created
November 12, 2015 19:48
-
-
Save anova/00373622ae7c1ca7f085 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
//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