Jump to content
Technics1210

Simple use of drawSVG on SVG-File

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

 

 

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.