Jump to content
Search Community

svg dotted line turns to solid on animation

Lacika1981 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

If I'm not mistaken ... you can't animate a dashed line because that is the very mechanism DrawSVG uses to simulate the drawing of a line ...

 

drawSVG Docs: It does this by controlling the stroke-dashoffsetand stroke-dasharray CSS properties.

https://greensock.com/drawSVG

 

But, you can emulate the desired presentation why using drawSVG on a series of lines,

 

See the Pen pqOqKG?editors=1010 by sgorneau (@sgorneau) on CodePen

 

  • Like 1
Link to comment
Share on other sites

Hi @Lacika1981,

 

A straight line on a solid background does not necessarily need drawSVG:

 

See the Pen Jwawyo by mikeK (@mikeK) on CodePen

 

Otherwise, it is advisable to look at the great examples of @PointC.  For example, this svg-stroke-dasharray-quick-tip

 

See the Pen wmmmmK by PointC (@PointC) on CodePen

 

Happy tweening ...

Mikel

 

 

 

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