2010-01-31 9 views
19

Après instanciation texte Raphaël comme siComment modifier le texte raphael?

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

comment puis-je faire pour modifier ce texte puis?

t.text = "test"; ne fonctionnait pas pour moi.

Répondre

37

Vous devez utiliser la méthode .attr()docs pour modifier le texte d'un élément de texte existant

comme celui-ci

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

Qu'en est-il définir et id pour un texte? Est-ce possible? –

+0

Je sais que je suis très en retard, mais serait-il possible ce que @ChiragTayal a demandé? Je me bats avec le même problème en ce moment. – Jef