Skip to content

Instantly share code, notes, and snippets.

@Chrisedmo
Last active October 11, 2015 07:58
Show Gist options
  • Save Chrisedmo/3827452 to your computer and use it in GitHub Desktop.
Save Chrisedmo/3827452 to your computer and use it in GitHub Desktop.
jQuery Display Current Window Dimensions
$(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());
};
});
@Chrisedmo
Copy link
Author

Obviously needs jQuery before… And remember to remove this once you have finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment