Jump to content
Search Community

Simple use of drawSVG on SVG-File

Technics1210 test
Moderator Tag

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

Hi,

 

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

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...