diff --git a/src/layzr.js b/src/layzr.js index 68b42ea..2a2aa6d 100644 --- a/src/layzr.js +++ b/src/layzr.js @@ -74,8 +74,9 @@ export default (options = {}) => { const nodeBot = nodeTop + node.offsetHeight const offset = (settings.threshold / 100) * windowHeight + const nodeRect = node.getBoundingClientRect() - return (nodeBot >= viewTop - offset) && (nodeTop <= viewBot + offset) + return (nodeRect.width !== 0) && (nodeBot >= viewTop - offset) && (nodeTop <= viewBot + offset) } // source helper