Jump to content
Search Community

Detecting Div the current scroll is on

mimeartist test
Moderator Tag

Recommended Posts

It's pretty tough to answer without a minimal demo. In general, it’s probably as simple as setting up a ScrollTrigger for each section and you can use the callbacks like onToggle or you can check isActive anytime you want for each instance. Again, it’s hard to offer advice when we don’t have a minimal demo to look at.

 

Here's a starter CodePen that loads all the plugins. Just click "fork" at the bottom right and make your minimal demo

See the Pen aYYOdN by GreenSock (@GreenSock) on CodePen

 

Using a framework/library like React, Vue, Next, etc.? 

CodePen isn't always ideal for these tools, so here are some Stackblitz starter templates that you can fork and import the gsap-trial NPM package for using any of the bonus plugins: 

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