You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to make an intersection event, which should be triggered only once (when an HTML element became visible - basically image lazy loading). On the The event handler Feature documentation page there is a [<count>] parameter mentioned, probably I should set it to 1 in a simple _hs expression after a simple command (on click 1 set...).
But this won't work:
data-script="on intersection(intersecting) having threshold 0.1 1 set {src: 'newSrc'} on me"
^ is this the right place for count?
I've tried it without having threshold 0.1 but in that case, all the images will be loaded immediately regardless they're in a non displaying element. Without the counter it redownloads every image on every intersection. I've tried halt on the end also, but it didn't help.
Do you have any suggestions?
Thank you.
Sorry if this place is not for hyperscript anymore :)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Dear Community,
Dear Developers,
I have a hyperscript problem.
I would like to make an intersection event, which should be triggered only once (when an HTML element became visible - basically image lazy loading). On the The event handler Feature documentation page there is a
[<count>]
parameter mentioned, probably I should set it to1
in a simple _hs expression after a simple command (on click 1 set...
).But this won't work:
I've tried it without
having threshold 0.1
but in that case, all the images will be loaded immediately regardless they're in a non displaying element. Without the counter it redownloads every image on every intersection. I've triedhalt
on the end also, but it didn't help.Do you have any suggestions?
Thank you.
Sorry if this place is not for hyperscript anymore :)
Beta Was this translation helpful? Give feedback.
All reactions