Secondly, I have an SVG form transform in different path using raphaeljs lib.
I would like to get a path by calling him with the function of raphaeljs 2.1.0 => getById(id);
However Chrome or Firefox tell me that there is no function getById ! I don’t understand why ?
This is a piece of my code :
rsrGroups = [path_c_trsp,path_i_trsp,path_l_trsp,path_o_trsp];
len = rsrGroups.length;
for(var i = 0; i < len; i++){
var el = rsrGroups[i];
el.mouseover(function() {
rsrGroupsMin.forEach(function(el){
var getPath = el.getById('el.id'); // here is the method called !
alert(getPath);
el.animate({opacity: 0.5},350,function () {});
rsrGroups2.forEach(function(tri){
tri.animate({opacity: 0.5},350,function () {});
});
});
this.animate({opacity: 1},350,function () {});
});
}
And this is the error given by Chrome :
Uncaught TypeError: Object Raphaël’s object has no method ‘getById’
I tried different things but no one works :/
getById is a method on the paper object, not the element i.e.
or if you don’t have access to the paper variable you could call el.paper.getById