dans le code suivant Quand 'choses' est un tableau de chemins ...En utilisant setAttribute avec un tableau de chemins Raphael
things.square = [ RM.path("m 154.21525,71.431259 74.32805,0 0,70.496711 -74.32805,0 0,-70.496711 z").attr(attr),
RM.path("m 271.25132,77.933263 58.07304,0 0,56.409037 -58.07304,0 0,-56.409037 z").attr(attr2) ];
... alors ce code ne fonctionne pas:
things.square[1].node.setAttribute("id","clicker");
, c'est-à-dire qu'il n'attribue pas le second chemin du tableau à l'identifiant 'clicker'. Cependant, 'choses' quand est un seul chemin ...
things.square = RM.path("m 154.21525,71.431259 74.32805,0 0,70.496711 -74.32805,0 0,-70.496711 z").attr(attr);
... il fonctionne très bien:
things.square.node.setAttribute("id","clicker");
Pourquoi? Et comment puis-je faire fonctionner le premier ensemble de chemins? Merci!