How to modify raphael text?

柔情痞子 提交于 2019-12-05 12:26:45

问题


After instantiating Raphael text like so

var t = paper.text(50, 50, "Raphaël\nkicks\nbutt!");

how do I go about then modifying that text?

t.text = "test"; did not work for me.


回答1:


You must use the .attr()docs method to change the text of an existing text element

like this

t.attr('text','new text here');


来源:https://stackoverflow.com/questions/2172618/how-to-modify-raphael-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!