public
Last active

Current screen width indicator (useful for knowing when to add breakpoints when resizing browser window)

  • Download Gist
RWD Screen Width Indicator
1 2 3 4 5 6 7 8 9 10
<script>
$(window).resize(function() {
var windowWidth = $(window).width();
$('.screen-width').text(windowWidth + 'px');
});
</script>
 
<div id="debug" style="position:fixed;padding:0.3em 0.6em;background:#f1f1f1;font-size:0.6em;bottom:0;left:50%;">
<span class="screen-width">0</span>
</div>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.