Skip to content

Instantly share code, notes, and snippets.

View brunomonteiro3's full-sized avatar

Bruno Monteiro brunomonteiro3

  • Empiricus Research
  • São Paulo, Brazil
View GitHub Profile
@brunomonteiro3
brunomonteiro3 / viewportsize.js
Last active April 8, 2022 19:57 — forked from thiagoeliasr/viewportsize.js
Display ViewPort and Screen Resolution at the top of screen. (This script was created intended to be a bookmarklet)
$(document).find('body').append('<div id="div-width-top" style="position: fixed; right: 5px; top: 5px; background: #000; color: #fff; padding: 10px; z-index: 99999; opacity: 0.7">Window Size:</div>');
$('#div-width-top').html('ViewPort: ' + window.innerWidth + 'px | Window: ' + screen.width + 'px');
$(window).resize(function() {
$('#div-width-top').html('ViewPort: ' + window.innerWidth + 'px | Window: ' + screen.width + 'px');
});