Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScrollDirection Leave === Reverse Doesn't fire anything. #1018

Open
aaronstezycki opened this issue Feb 15, 2023 · 1 comment
Open

ScrollDirection Leave === Reverse Doesn't fire anything. #1018

aaronstezycki opened this issue Feb 15, 2023 · 1 comment

Comments

@aaronstezycki
Copy link

I'm creating a custom sticky component, whereby I need to add, remove classes based on position (pretty simple).

I'm just testing the following, and .on("leave") used with scrollDirection === "REVERSE" does not fire anything.

var pin = new ScrollMagic.Scene({
  triggerElement: element,
  duration: element.offsetHeight
})
  on("leave", (e) => {
    if (e.scrollDirection === "FORWARD") {
      console.log('Leave: Forward'); // Works
    }
    if (e.scrollDirection === "REVERSE") {
       console.log('Leave: Backwards'); // Does not work where you expect it too.
    }
  })

The console log tends to fire on "start" "reverse" (at the top heading up), rather than "leave" "reverse" (at the bottom heading up) where you expect it too.

I understand version 3 is here, but documentation needs updating and I don't have the time to go through this without clear help.

I do think others have hit this problem too with v2. #1004

@shuklabhisekh
Copy link

shuklabhisekh commented Oct 17, 2023

Hey, please assign this issue to me. I would like to work on this. @aaronstezycki could you please add a dummy code of the functionality on any online editor which is not working as it will help me to understand the issue in better way and add the link here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants