Raphael 中的可编辑文本
有没有办法使 svg 文本在 Raphaël JS 中可编辑,如 SVG 1.2 规范中所述(http://www.w3.org/TR/2004/WD-SVG12-20040226/#text-edit)?
textelement.attr("editable", "true");
没有像我希望的那样将 editable 属性添加到文本元素。
如果没有办法,我想我将不得不使用悬停的 html 文本元素......
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您链接到的规范是工作草案(正在进行中,可能会发生变化)。但是,SVG Tiny 1.2 规范确实具有几乎 同样的事情,并且它是 w3c 推荐。当然,这并不能神奇地让每个实现都按照它所说的去做,但它至少是稳定的。
如果您正在寻找支持“可编辑” 在 svg 文本元素上,Opera 就是一个例子。
The specification you link to is a working draft (a work in progress, subject to change). However, the SVG Tiny 1.2 spec does have almost the same thing, and it is a w3c Recommendation. Of course that doesn't magically make every implementation do what it says, but it's at least stable.
If you're looking for an implementation that does support 'editable' on svg text elements, then Opera is one example.
Raphael 不是 100% SVG 实现。它仅使用 SVG 和VML作为基础。因此,有些东西可能会起作用,而另一些东西可能不会像你期望的那样工作,有些东西根本不起作用。
Raphael isn't a 100% SVG implementation. It only uses SVG & VML as a base. Therefore somethings may work, while others don't work quite as you expect and somethings don't work at all.