Last active
August 29, 2015 14:08
-
-
Save ourmaninamsterdam/2aeb3d699bdd99f26aa6 to your computer and use it in GitHub Desktop.
Check if element is within viewport
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
Popover.prototype.isOverlappingViewport = function($el) { | |
return this.getElementBoundaries($el).top < 0? true : false || | |
this.getElementBoundaries($el).bottom > $('body').height()? true : false || | |
this.getElementBoundaries($el).left < 0? true : false || | |
this.getElementBoundaries($el).right > $('body').width()? true : false; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment