Answer the question
In order to leave comments, you need to log in
Is it possible to access path inside svg sprite using js?
Hi all.
There is the following:
Part of the sprite:
<symbol id="electric">
<path id="back_light" d="M1026.6,144.9l-4-0.7l-3.4.5l-2.9,17..." />
<path id="front_light" d="M1026.6,144.9l-4-0.7l-3.4.5l-2.9,17..." />
..
</symbol>
<svg class="moto-part moto-part-electric">
<use data-id="electric" xlink:href="images/moto.svg#electric"/>
</svg>
Answer the question
In order to leave comments, you need to log in
Maybe. Everything is done through DOM elements. Look at specialized sites for how to implement this. This is discussed in detail here. And here too.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question