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 11f3387 commit 253ac4aCopy full SHA for 253ac4a
src/pat/scroll/scroll.js
@@ -52,12 +52,15 @@ class Pattern extends BasePattern {
52
await utils.timeout(this.options.delay);
53
}
54
55
- const target = this.get_target();
56
- const scroll_container = dom.find_scroll_container(
57
- target.parentElement,
58
- this.options.direction === "top" ? "y" : "x",
59
- window
60
- );
+ const target = this.get_target() || document.body;
+ const scroll_container =
+ target === document.body
+ ? document.body
+ : dom.find_scroll_container(
+ target.parentElement,
61
+ this.options.direction === "top" ? "y" : "x",
62
+ window
63
+ );
64
65
// Set/remove classes on beginning and end of scroll
66
this.el.classList.add("pat-scroll-animated");
0 commit comments