我在 HTML 文档中有一个 SVG,并且希望将其制作为当我单击矩形时它会移动到顶层。我对此唯一发现的是:
返回 this.parent.removeElement(this).put(this);
但这不起作用。
最佳答案
你想要insertBefore或appendChild而不是removeElement和put
insertBefore/appendChild 都将元素从放置在其他位置时所在的位置删除。
关于javascript - 使用 javascript 更改 SVG 元素的顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27670991/