In this release, you can use a function for specifying an offset value. This will allow you to have dynamic values for offsets (for example, when using window.innerHeight
). This will be helpful in case the user resizes the window.
Example:
ScrollObserver.Element(element, {
offsetBottom: () => window.innerHeight - element.clientHeight
})