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>
Written by Chris
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#