Last active
September 18, 2018 08:49
-
-
Save JoshyFrancis/2354a13fadc0e0fa240de83acf836949 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
How to find out the document width and height very easily? | |
in HTML | |
<span id="hidden_placer" style="position:absolute;right:0;bottom:0;visibility:hidden;"></span> | |
in javascript | |
var c=document.querySelector('#hidden_placer'); | |
var r=c.getBoundingClientRect(); | |
r.right=document width | |
r.bottom=document height | |
You may update this on every window resize event, if needed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment