Last Updated: February 25, 2016
·
285
· chrisdemetriad

Screen width and height

load jQuery first then:

<script>
jQuery(document).ready(function() {

screen_width();

jQuery(window).resize(function() { screen_width(); 
});

function screen_width() {
jQuery("#screen-width").html($(window).width());
jQuery("#screen-height").html($(window).height()); 
}
});
</script>

get this in the header/footer

<div style="position: absolute; left: 50%; background: lime; color: orange; border-radius: 5px; padding:10px; font-family: Calibri;">
<div>Width: <span id="screen-width"></span></div>
<div>Height: <span id="screen-height"></span></div>
</div>