Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
eisenheim94

Snap.svg dynamic load and TweenMax

Recommended Posts

I'm loading my SVG files into different elements on my website. I'm trying to animate it with TimelineMax and it's didn't animated. I think it's because SVGs loaded dynamically and TweenMax didn't see them. How to animate them with TweenMax?

Link to comment
Share on other sites

So strange.. My code isn't working when I'm trying to animate <g> elements

Link to comment
Share on other sites

Can I do this outside of SVG loading function?

Link to comment
Share on other sites

You can't animate anything until the SVG has loaded. What are you trying to animate on your <g> elements? Can you fork one of those plunks I linked to with something similar to what you are trying to do?

  • Like 1
Link to comment
Share on other sites

You can't animate anything until the SVG has loaded. What are you trying to animate on your <g> elements? Can you fork one of those plunks I linked to with something similar to what you are trying to do?

 

I understood.. Need to wait until all SVGs will be loaded with when/then. Not the best option, but works.

Link to comment
Share on other sites

If you can make a demo, I might be able to help you out more.

 

Taking from this example...

http://plnkr.co/edit/IFdyoy7sZ9bBDIv8bpdW?p=preview

 

It might be easier to structure your code if you think of the init function in that demo as jQuery's ready method. So all your code doesn't have to be inside that function. Just what's needed to start your app.

  • Like 1
Link to comment
Share on other sites

If you can make a demo, I might be able to help you out more.

 

Taking from this example...

http://plnkr.co/edit/IFdyoy7sZ9bBDIv8bpdW?p=preview

 

It might be easier to structure your code if you think of the init function in that demo as jQuery's ready method. So all your code doesn't have to be inside that function. Just what's needed to start your app.

I have a lot (more than 60) svg files to load. Rewritten all their loader.

  • Like 1
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.
×