이벤트를 클릭 한 후에 표시하기 때문에 Raphael 세트에 id를 설정하고 싶습니다. set.id = -1 :이 방법으로 ID를 설정하는"Raphaeljs set"에 id를 설정하십시오.
function show(){
var element = space2Draw.getById(-1);
element.show();
}
}
불가능 :
내 페이지에서var divResult = document.getElementById('printResult');
var space2Draw = Raphael(divResult, 1600, 900);
var st = space2Draw.set();
st.push(
space2Draw.circle(newXCoordinates, newYCoordinates, 20).click((function (valore) {
return function() {
window.open("index-point.html?id=" + (valore) + "&type=" + type + "&description=" + description + "&name=" + name);
}
}(valore))).mouseover(function() {
this.attr({ 'cursor': 'pointer' });
this.attr({ 'opacity': '.50' });
}).mouseout(function() {
this.attr({ 'opacity': '1' });
})
);
내가 버튼이 있습니다
이 내 설정되어 있습니까? ID를 설정 한 다음 해당 세트를 어떻게 찾을 수 있습니까?
도움을 미리 감사드립니다.
나는 시도했다 : st.node.setAttribute ("id", "element_id") 오류가있다 : 잡히지 않은 TypeError : 정의되지 않은 메서드 'setAttribute'를 호출 할 수 없다 – ilamaiolo
이것을 설명하기 위해 내 대답을 다시 작성했다. Raphael은 집합을 하나의 개체로 취급 할 수 없으므로 setAttribute 메서드는 적용 할 수 없습니다. 대신, 집합의 각 객체를 변경해야합니다 (그리고 CSS 클래스를 할당해야합니다). 더 자세한 설명은 위를 참조하십시오. – gatotkaca