s4my
April 4, 2024, 9:52am
1
How can I add an event listener for the “scroll” event? I tried the following (and some other stuff to be honest), and it didn’t work:
requireApiVersion("0.15.0") ? activeDocument = activeWindow.document : activeDocument = window.document;
this.registerDomEvent(activeDocument, "scroll", () => console.log("scrolling..."));
Lots of examples on Github. I searched for onscroll
.
https://github.com/search?q=obsidian+onscroll+language%3ATypeScript&type=code&l=TypeScript
You have to be logged into Github to use the above search.
s4my
April 5, 2024, 5:26am
3
Thank you, none of them helped, but searching for registerdomevent scroll
did. The thing I was missing was that the event is called “wheel” instead of “scroll” .
system
Closed
April 12, 2024, 5:27am
4
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.