我有以下代码:
var rsr = Raphael('rsr2', '660', '400');
var Layer_x0020_1 = rsr.set();
var path_a = rsr.path(" M154 263l9 41 -1 5c-17,-4 -38,-11 -56,-20l18 -37c10,4 19,8 30,11z");
path_a.attr({
class: 'fil0',
filter: 'url(#Filter)',
"level":"5",
parent: 'Layer_x0020_1',
'stroke-width': '0',
'stroke-opacity': '1'
}).data('id', 'path_a');
Layer_x0020_1.attr({
'id': 'Layer_x0020_1',
'filter': 'url(#Filter)',
'name': 'Layer_x0020_1'
});
$('path').attr({'fill':'#b4b3b0'});
var rsrGroups = [Layer_x0020_1];
有level
属性。但是,Raphael
无视它。这是生成的标记Raphael
:
<div id="rsr2">
<svg height="400" version="1.1" width="660" xmlns="http://www.w3.org/2000/svg" style="overflow:hidden;position:relative">
<desc>Created with Raphaël 2.1.0</desc>
<defs></defs>
<path style="stroke-opacity: 1" fill="#b4b3b0" stroke="#000000" d="M154,263L163,304L162,309C145,305,124,298,106,289L124,252C134,256,143,260,154,263Z" stroke-width="0" stroke-opacity="1"></path>
</svg>
</div>
怎么说Raphael
添加level
属性到路径?
谢谢。