Try Install Learn Blog API Packages GitHub
Pages
Standard Library

Search
Entities

IntersectionObserver

Functions

new
(
rootMargin
:
String
treshold
:
Number
callback
:
Function(Number, a)
)
:
IntersectionObserver

Creates a new intersection observer.

observer =
  IntersectionObserver.new("50px", 0.1,
    (intersectionRatio : Number) {
      if (intersectionRatio == 1) {
        Debug.log("Fully visible!")
      } else {
        Debug.log("Not fully visible!")
      }
    })
observe
(
element
:
Dom.Element
observer
:
IntersectionObserver
)
:
IntersectionObserver

Observes the given element.

unobserve
(
element
:
Dom.Element
observer
:
IntersectionObserver
)
:
IntersectionObserver

Unobserves the given element.