inter123
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by inter123
-
-
15 minutes ago, ZachSaucier said:
Hey inter123 and welcome to the GreenSock forums. Thanks for being a Club GreenSock member!
This demo is working exactly as I would expect it to. Can you please try re-explaining what you're trying to accomplish? And what part of it, specifically, is not meeting your expectations?
onComplete
fires when the tween is done completing...window.addEventListener("scroll", onScroll);
will fireonScroll
every time the page is scrolled, whether or not it's caused by the tween or user interaction.Hi Zach thank you for the response.
My main question goes along the lines of:
1. onComplete fires after scrollTo is done and scrolling has supposedly stopped
2. my onComplete sets the variable: scrolling = false
3. How does "window onScroll" pick up "scrolling = false" sometimes, if supposedly the scrolling has stopped and the variable was not changed until after the scrolling was done?
-
For this example:
1. Click "scroll" button
2. Go back to top
3. Keep clicking "scroll" button
In the console, I am printing out the event listener for the "onScroll" function which is tracking the window scroll.
For some reason when the "onComplete" fires after the scroll is done, the "onScroll" function randomly sometimes runs again.
The last console log, will randomly sometimes randomly change to "false". Even though i would expect the behavior to always be "true". It seems that the "false" can be triggered randomly.
I am wondering if this behavior can be worked around?
Thank you
See the Pen povZmVa?editors=1111 by sbdev (@sbdev) on CodePen
scrollTo onComplete firing after the scroll has been completed.
in GSAP
Posted
Thank you for the detailed explanation, makes perfect sense. I just wanted to be sure I was understanding the behavior correctly. I believe your ideas will definitely help.