Last active
October 8, 2022 01:24
-
-
Save thiagoeliasr/328882806a58f600b7eb to your computer and use it in GitHub Desktop.
Display ViewPort and Screen Resolution at the top of screen. (This script was created intended to be a bookmarklet)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use as bookmarklet, just create a new item on your browser, and register the code as the URL: