Jump to content
Search Community

Detect Stop scrolling

Rahul Dey test
Moderator Tag

Recommended Posts

Thanks for replying so quick. But scrollEnd event is a global event what if I want in particular instance. Maybe we could do some sort of state management. Like 

let section1_active = false;

const section1Tl = gsap.timeline({
    scrollTrigger: {
        trigger: ".section1",
        onUpdate: (self) => {
            section1_active = self.isActive
        },
    }
})

ScrollTrigger.addEventListener("scrollEnd", () => {
	if(section1_active) {
    	// Do Something
    }
});

 

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...