Skip to content

Instantly share code, notes, and snippets.

@lzcabrera
Last active December 14, 2015 09:09
Show Gist options
  • Save lzcabrera/5063097 to your computer and use it in GitHub Desktop.
Save lzcabrera/5063097 to your computer and use it in GitHub Desktop.
snippet to display responsive width
<div id="fqv" style="position:fixed;top:4px;left:4px;z-index:999;color:#fff;">
<p style="font-size:12px;background:rgba(0,0,0,0.75);padding:5px;margin-bottom:1px;line-height:1.2;">
<span id="window-width"></span>
</p>
</div>
$(window).load(function() {
var $win = $(window);
function update () {
/*if($win.width > 768){
}else{
}*/
$('#window-width').html('width: '+$(window).width()+'px');
};
update(); // call when the DOM is ready
// Call when the viewport resizes:
$win.on('resize', update);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment