Jump to content
Search Community

Kill trigger without a timeline

Sacha test
Moderator Tag

Go to solution Solved by akapowl,

Recommended Posts

Hey, I'm having problems killing / deactivating a scrolltrigger after it got activated. My goal is to play a html video at a specific point with the scrolltrigger. After the video got started once, the scrolltrigger should be removed. I tried finding something in the docs but could only find the ScrollTrigger.kill() function, which kills all ScrollTriggers or how to kill a timeline. Is it possible to only kill certain triggers, for example using an ID or something similar without using a whole timeline?

 

const video = document.querySelector("video");

ScrollTrigger.create({
                trigger: video,
                start: "bottom bottom",
                markers: true,
                id: i,
                onToggle: () => video.play() + ScrollTrigger.kill(),
                toggleActions: 'play none none none',
});

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...