Jump to content
Search Community

can i use drawSVG plugin on an SVG referenced by an image tag?

kakarlus test
Moderator Tag

Go to solution Solved by Carl,

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

Hello Guys,

 

Seems impossible but i don't want to populate my html file with a lot of svg elements :/

I am referencing my svg files using this code so i won't see a lot in my .html file.

<img src="mySVG.svg" id="mySVG" />

 

Would it be possible to animate the objects inside that svg file?

 

Regards,

Carlos

Link to comment
Share on other sites

  • Solution

If you don't want your HTML to be messed up with lots of SVG mess the best thing to do is to load them and inject them at runtime.

Blake has a bunch of demos showing different ways to do this. Study the JS files in each:

 

http://plnkr.co/edit/5l2al3EPl9HIK2FQgO2C?p=preview

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

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

  • Like 4
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...