Created
July 22, 2012 05:12
-
-
Save gormus/3158517 to your computer and use it in GitHub Desktop.
Appends an info box to body for displaying the window size. Box content is refreshed by the window resize.
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
$(document).ready(function () { | |
$('<div id="WINDOW_SIZE">' + $(window).width() + 'x' + $(window).height() + '</div>') | |
.attr('unselectable', 'on') | |
.css({ | |
'position' : 'fixed', | |
'bottom' : 0, | |
'right' : 0, | |
'background' : '#000000', | |
'color' : '#FFFFFF', | |
'font' : '16px/1 sans-serif', | |
'padding' : '10px', | |
'z-index' : 999999, | |
'cursor' : 'default', | |
'-moz-user-select' : 'none', | |
'-webkit-user-select' : 'none', | |
'user-select' : 'none', | |
'-ms-user-select' : 'none' | |
}) | |
.appendTo('body'); | |
}); | |
$(window).resize(function () { | |
$("#WINDOW_SIZE").text($(window).width() + 'x' + $(window).height()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment