Raphael 中的可编辑文本

发布于 2024-12-01 09:42:14 字数 357 浏览 5 评论 0 原文

有没有办法使 svg 文本在 Raphaël JS 中可编辑,如 SVG 1.2 规范中所述(http://www.w3.org/TR/2004/WD-SVG12-20040226/#text-edit)?

textelement.attr("editable", "true");

没有像我希望的那样将 editable 属性添加到文本元素。

如果没有办法,我想我将不得不使用悬停的 html 文本元素......

Is there a way to make a svg text editable in Raphaël JS as described in the SVG 1.2 Specifications (http://www.w3.org/TR/2004/WD-SVG12-20040226/#text-edit)?

textelement.attr("editable", "true");

does not add the editable attribute to the textelement as I had hoped.

If there is no way I guess I will have to work with hovering html textelements…

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

好多鱼好多余 2024-12-08 09:42:14

您链接到的规范是工作草案(正在进行中,可能会发生变化)。但是,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.

木槿暧夏七纪年 2024-12-08 09:42:14

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文