Jump to content

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

Simple use of drawSVG on SVG-File

Recommended Posts



is it possible to use drawSVG when an (local) SVG-Image (logo.svg - Vector Logo) is loaded as object into the html source code? And how do i access the ID of this file? Or do i have to use the <svg> tag inside html?


Thanks for helping



Link to comment
Share on other sites

Hello Technics, 


Are you asking if drawSVG can be used on SVGs that are in an img or object tag? Like <img src="foo.svg"/> or <object data="foo.svg"></object>? 


If so, the answer is it's not very easy to (this is due to how browsers handle img and object tags, not a problem with GSAP). You should include the SVG as an <svg> tag. This thread about SVGs can help you learn how to do so properly if you run into errors.

  • Like 2
Link to comment
Share on other sites

Hi @Technics1210


I'd recommend just using an inline SVG, but we've had some discussions about injecting the SVG too. Here's a good one:

Happy tweening.



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