Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var isInViewport = function (elem) {
- var bounding = elem.getBoundingClientRect();
- return (
- bounding.top >= 0 &&
- bounding.left >= 0 &&
- bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
- bounding.right <= (window.innerWidth || document.documentElement.clientWidth)
- );
- };
Add Comment
Please, Sign In to add comment