decemberly Posted April 15 Posted April 15 I have a series of sections stacked vertically, and some of them include audio. The audio is triggered using onEnter and onEnterBack events, and paused with onLeave and onLeaveBack, so that audio plays only while its associated section is in view. This setup works as expected during manual scrolling. However, I also have a "Scroll to top" button that smoothly scrolls back to the top. The issue is: when I click this button, I still hear a brief snippet of audio—about half a second—even though I expect no sound to play during that transition. Steps to reproduce: Click the "Allow audio" button. Manually scroll to the bottom — you'll hear audio playing in the middle section. Click the "Scroll to top" button — you’ll hear a short audio blip as the scroll passes through the audio section. See the Pen oggvyeq by decemberly (@decemberly) on CodePen.
Solution Rodrigo Posted April 15 Solution Posted April 15 Hi, You can use some simple conditional logic to achieve this, something like this: See the Pen qEEWwrO by GreenSock (@GreenSock) on CodePen. Hopefully this helps Happy Tweening!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now