SVG re-ordering z-index (Raphael optional)

后端 未结 6 2031
鱼传尺愫
鱼传尺愫 2020-11-27 04:45

How can I reorder Raphael or their underlying SVG elements after creation. Better yet, do something like layers exist in SVG?

Ideally I would like two or more layers

6条回答
  •  醉梦人生
    2020-11-27 05:18

    There's no z-index in SVG, objects that are later in the code appear above the first ones. So for your needs, you can move the node to the start of the tree or the end of it.

    (group) element is a generic container in svg, so they can be layers for you. Just move nodes between the groups to achieve what you need.

提交回复
热议问题