jQuery - Raphael - SVG - selector based on custom data

前端 未结 2 1259
渐次进展
渐次进展 2021-01-20 05:36

I have assigned a custom data attribute to some circles added to the Raphael canvas as follows in a each() loop:

marker.data(\'transaction\', tr         


        
2条回答
  •  不要未来只要你来
    2021-01-20 06:15

    I think the problem is that jQuery has no access to the SVG nodes. You have to try normal Javascript. The problem could be the compatibility with older browsers if you use querySelectorAll.

    Look here: http://dean.edwards.name/jsb/behavior/querySelectorAll.html and here: http://www.w3.org/TR/selectors-api/#queryselectorall

    Possible solution: Have a look in Raphael-Doc : http://raphaeljs.com/reference.html#Element.data

提交回复
热议问题