0
3D 원을 만들어 클릭 할 수 있고 그 데이터를 표시하려고합니다. 나는 그것이 작동하도록 할 수없는 것 같습니다. 누군가 나에게 이것을 이해시키는 것을 도와 줄 수 있냐? ??? 내가 잘못 여기에 도착하면 사과 난이 바닥 근처 수행하려고 코드 ....Raphael JS로 클릭 가능한 개체 만들기
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Raphaël · Ball</title>
<link rel="stylesheet" href="demo.css" type="text/css" media="screen">
<link rel="stylesheet" href="demo-print.css" type="text/css" media="print">
<script src="raphael.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
Raphael.fn.ball = function (x, y, r, hue) {
hue = hue || 0;
return this.set(
//this part is the drop shadow
this.ellipse(x, y + r - r/5, r, r/2).attr({fill: "rhsb(" + hue + ", 1, .25)-hsb(" + hue + ", 1, .25)", stroke: "none", opacity: 0}),
//this part is the top part of the circle
this.ellipse(x, y, r, r).attr({fill: "r(.5,.9)hsb(" + hue + ", 1, .75)-hsb(" + hue + ", .5, .25)", stroke: "none"}),
//this is the inner glow part from the top
this.ellipse(x, y, r - r/5, r - r/20).attr({stroke: "none", fill: "r(.5,.1)#ccc-#ccc", opacity: 0})
);
};
window.onload = function() {
var R = Raphael("holder"), x = 300, y = 100, r = 100;
//I cant tell what numbers are passed into here?????
R.ball(x, y, r, Math.random()).data("i", i).click(function() {
alert(this.data("i"));
});
};
</script>
</head>
<body>
<div id="holder"></div>
</body>
</html>
포스트 그것을 jsfiddle에 당신은 내가 무엇을 제안하려고한다 –
당신이 ... ..... 당신은 당신의 코드에서 var에 난을 선언 할 수있는 경우는 .... 그것을 이잖아. ... – Aukhan