-
-
Save piyushchauhan2011/9cf9b910da7a9587287ed6bbaa027495 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