두 번째로, 나는 raphaeljs lib를 사용하여 다른 경로에서 SVG 형식을 변환합니다.
나는 그를 raphaeljs 함수로 호출하여 경로를 얻고 싶습니다. 2.1.0 => getById (id);
그러나 Chrome이나 Firefox는 getById 함수가 없다고 알려줍니다! 왜 그런지 모르겠다 고요? function getById Raphael js
이
내 코드의 일부입니다 :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() {});
});
}
그리고이 크롬에 의해 주어진 오류입니다 : 내가 다른 일을 시도
Uncaught TypeError: Object Raphaël’s object has no method 'getById'
그러나 아무도는 작동하지 않습니다 :/
고맙다. 내 코드를보고 나 혼자서 찾는다. ^^ var을해야한다. getPath = ** rsr **. getById (this.id); – Glou94