B
B
bQ12020-02-25 13:00:16
Layout
bQ1, 2020-02-25 13:00:16

How to make dotted line drawing animation in svg?

How to make dotted line drawing animation in svg?

I'm trying to use animejs, but it turns the dotted line into a regular one
Code:

anime({
                targets: 'svg .line',
                strokeDashoffset: [anime.setDashoffset, 0],
                easing: 'easeInOutSine',
                duration: 1500,
            });


When I try to prescribe in styles stroke-dasharray: 3;so that there is a dotted line, and then I start the same animation, the strip just moves (like a running line), and is not drawn. (

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RAX7, 2020-02-25
@bQ1

Through strokeDashoffset, it will not be possible to make an animation of drawing a dashed line. You can make a mask for the line and animate it already.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question