Last active
October 11, 2015 07:58
-
-
Save Chrisedmo/3827452 to your computer and use it in GitHub Desktop.
jQuery Display Current Window Dimensions
This file contains hidden or 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 () { | |
windowWrap(); | |
displayWindowSize(); | |
$(window).resize(function () { | |
displayWindowSize(); | |
}); | |
function windowWrap() { | |
$('body').append('<div id="dev" style="position: fixed; top: 0; right: 0; color: #f00; font-weight: bold;"></div>'); | |
}; | |
function displayWindowSize() { | |
$('#dev').html($(window).width() + "x" + $(window).innerHeight()); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Obviously needs jQuery before… And remember to remove this once you have finished.