SVG re-ordering z-index (Raphael optional)

后端 未结 6 2046
鱼传尺愫
鱼传尺愫 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:00

    Actually, I think appendChild() alone will copy the element and not just move it. This may not be a problem but if you want to avoid duplicates I suggest something like this:

    el.parentNode.appendChild(el.parentNode.removeChild(el));
    

提交回复
热议问题