We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 515e9fc commit 492eae1Copy full SHA for 492eae1
src/index.js
@@ -63,7 +63,8 @@ class ScrollTrigger extends Component {
63
const element = ReactDOM.findDOMNode(this.element);
64
const elementRect = element.getBoundingClientRect();
65
const viewportStart = 0;
66
- const viewportEnd = document.body.clientHeight;
+ const scrollingElement = document.scrollingElement || document.body;
67
+ const viewportEnd = scrollingElement.clientHeight;
68
const inViewport = elementRect.top < viewportEnd && elementRect.bottom > viewportStart;
69
70
const position = window.scrollY;
0 commit comments