Created
February 17, 2016 20:48
-
-
Save christopherbauer/770aa123b7ee33c1c421 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
| function isAnyPartOutsideViewPort($element) { //THIS SHOULD BE LIB FUNCTION | |
| var element = $element[0]; | |
| var rect = element.getBoundingClientRect(); | |
| return rect.top <= 0 || | |
| rect.left <= 0 || | |
| rect.bottom >= $(window).height() || | |
| rect.right >= $(window).width(); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://jsfiddle.net/6ths8x9w/