Jump to content
Search Community

Snap.svg dynamic load and TweenMax

eisenheim94 test
Moderator Tag

Go to solution Solved by OSUblake,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

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

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

  • Solution

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.
×
×
  • Create New...