我在项目中使用 Raphael 库创建 SVG。我将 id 设置为 SVG。
问题是;我没有找到以 Id 的 raphael 论文形式获取 SVG 对象的方法。当我使用像 $(filterId) 或 $(filterId)[0]
这样的 jQuery 获取 SVG 时,它返回 SVGSVGElement
对象,因此我无法使用 Raphael 的函数。
Raphael("filterDiv", 1100, 1000);
$("svg:last").attr("id","filterId");
谢谢
最佳答案
SVG 元素和 Raphael 对象不是同一件事。创建 Raphael 对象时最好存储它,例如paper=Raphael("filterDiv", 1100, 1000);
.
关于jquery - 获取 SVG 元素作为 Raphael 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12369335/