Last active
December 31, 2015 05:39
-
-
Save marksy/7942649 to your computer and use it in GitHub Desktop.
devTools shows viewport dimensions on screen for rwd
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
var viewportX = $(window).width(); | |
var viewportY = $(window).height(); | |
var docY = $(document).height(); | |
$('body').append('<div id=\"dev-tools\"></div>'); | |
$('#dev-tools').css('display', 'block').html('<span class="alt-color">width:</span>' + viewportX + 'px <span class="alt-color">height:</span>' + viewportY + 'px <span class="alt-color">docHeight:</span> ' + docY + 'px'); | |
$(window).resize(function () { | |
var viewportX = $(window).width(); | |
var viewportY = $(window).height(); | |
var docY = $(document).height(); | |
$('#dev-tools').css('display', 'block').html('<span class="alt-color">width:</span>' + viewportX + 'px <span class="alt-color">height:</span>' + viewportY + 'px <span class="alt-color">docHeight:</span> ' + docY + 'px'); | |
}); | |
$('#dev-tools').hover(function () { | |
$(this).toggleClass('switch'); | |
}, function () { | |
}); |
Version 1.02
shows the actual document height
Version 1.03
No longer needs modification of DOM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version 1.01
when you roll over it changes position,