We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f17e7b4 + d3fec2c commit 79b737dCopy full SHA for 79b737d
src/animation/frontend.js
@@ -284,8 +284,9 @@ const isElementInViewport = ( el ) => {
284
};
285
286
return (
287
- ( bounds.bottom >= viewport.top && bounds.bottom <= viewport.bottom ) ||
288
- ( bounds.top <= viewport.bottom && bounds.top >= viewport.top )
+ ( bounds.bottom >= viewport.top && bounds.top <= viewport.bottom ) || // Element spans the viewport
+ ( bounds.top <= viewport.bottom && bounds.bottom >= viewport.bottom ) || // Top part of the element is in the viewport
289
+ ( bounds.bottom >= viewport.top && bounds.top <= viewport.top ) // Bottom part of the element is in the viewport
290
);
291
292
0 commit comments