Hi Jack, Thanks for this reply. Sorry if I wasn't clear. I want the unpin event to be unrelated to scrolling. That is, say an element we want to pin contains a video. Instead of pinning the element for 300px, as you suggested, I want the element to remain pinned until the video is watched to completion. That is, unrelated to scroll position. The user could scroll as much as they want, but until the video completes playing, the container holding the video would remain pinned. Once the video completes, the user is free to continue scrolling to the content below. So the `end` property (or some related property) would not be tied to scroll position but would be listening for a state change triggered by the video api announcing the end of the video. Does that make sense? Is this possible to achieve with ScrollTrigger?
If this is not possible, I suppose my other questions are moot. But hopefully they both make sense to you now. That is, there would be no "pinned for 300px" to define what the padding needs to be. And "certain scroll positions" would not trigger certain things. Other JavaScript events, not scroll position, would trigger the unpinning. So in theory, the user should be able to continue scrolling indefinitely so long as the flag for continuing is not triggered.
I can put together a codepen demo (with pseudocode, since I don't know which properties would enable this) and share it here. But I'm mostly just wanting to know if this is even possible.
Thanks.