foxhound3311

Start and Stop Animations with Scroll Jquery Event - Not Working

Recommended Posts

This is my first GSAP animation. I'm very new to this and Jquery. I'm trying to create an animation that will play once the user scrolls to it on the website. I created a scroll script that works great when i'm simply changing a background-color when the users scroll to the element, but i can't figure out how to attach it to my SVG animation. I thought it would be as simple as nesting my GSAP code within my Jqeury  but it's not working.

My goal is to have the SVG play once the user scrolls to it, and then stop playing if the user scroll away from the icon.

 

I also notice the SVG is floating outside of the Div. 

 

Any advice would be appreciated.

Share this post


Link to post
Share on other sites

Holy Smokes Batman. I will check this out. I could not find a working example. Do you have one by chance?

Share this post


Link to post
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.