Created
April 13, 2016 22:25
-
-
Save amcdnl/1fb1cdf2f7e6aab81be853c4c97d4cf2 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
| var element = document.getElementById("panda"); | |
| function checkVisibility() { | |
| var bounds = element.getBoundingClientRect(), | |
| visible = bounds.width && bounds.height; | |
| if (visible) { | |
| doMySizeMagic(); | |
| } else { | |
| setTimeout(checkVisibility, 100); | |
| } | |
| }; | |
| checkVisibility(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment