Can hx-trigger="load" only execute if the element is visible? #1142
deanebarker
started this conversation in
General
Replies: 3 comments 1 reply
|
Same issue here, did you find a solution? |
0 replies
|
No, sorry. But I did figure out how to tie stuff to document events, which is probably how I would approach it now. (I answered my own question there...) |
1 reply
|
Yes, in that example, I was listening for an event on the body (so, the entire document). I believe you can listen for events on specific elements too. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I have some elements that are hidden on mobile. They have
hx-trigger="load"on them, and theGETrequest is executing even when they're not shown.I tried changing it to
hx-trigger="revealed", but they still executed, because they are technically in the viewport, they're just not visible.I'd like this to not execute if they're hidden.
All reactions