如何修改raphael文本? [英] How to modify raphael text?

查看:71
本文介绍了如何修改raphael文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在实例化Raphael文本后如此

After instantiating Raphael text like so

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

如何修改该文本?

t.text =test; 对我不起作用。

推荐答案

您必须使用 .attr() docs 方法更改现有文本元素的文本

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

像这样

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

这篇关于如何修改raphael文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆