<! DOCTYPE html>
<meta charset= "Utf-8" >
<title>raphaël Gear</title>
<link rel= "stylesheet" href= "demo.css" media= "screen" >
<link rel= "stylesheet" href= "Demo-print.css" media= "print" >
<meta name= "viewport" content= "Width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" >
<script src= "Scripts/raphael.js" ></script>
<script>
Raphael ("Holder", 640, 480, function () {
var r = this,
p = R.path ("m295.186,122.908c12.434,18.149,32.781,18.149,45.215,0l12.152-17.736c12.434-18.149, 22.109-15.005,21.5,6.986l-0.596,21.49c-0.609,21.992,15.852,33.952,36.579,26.578l20.257-7.207c20.728-7.375, 26.707,0.856,13.288,18.29l-13.113,17.037c-13.419,17.434-7.132,36.784,13.971,43.001l20.624,6.076c21.103, 6.217,21.103,16.391,0,22.608l-20.624,6.076c-21.103,6.217-27.39,25.567-13.971,43.001l13.113,17.037c13.419, 17.434,7.439,25.664-13.287,18.289l-20.259-7.207c-20.727-7.375-37.188,4.585-36.578,26.576l0.596,21.492c0.609, 21.991-9.066,25.135-21.5,6.986l340.4,374.543c-12.434-18.148-32.781-18.148-45.215,0.001l-12.152,17.736c-12.434, 18.149-22.109,15.006-21.5-6.985l0.595-21.492c0.609-21.991-15.851-33.951-36.578-26.576l-20.257,7.207c-20.727, 7.375-26.707-0.855-13.288-18.29l13.112-17.035c13.419-17.435, 7.132-36.785-13.972-43.002l-20.623-6.076c-21.104-6.217-21.104-16.391,0-22.608l20.623-6.076c21.104-6.217, 27.391-25.568,13.972-43.002l-13.112-17.036c-13.419-17.434-7.439-25.664,13.288-18.29l20.256,7.207c20.728,7.374,37.188-4.585,36.579-26.577l-0.595-21.49c-0.609-21.992,9.066-25.136,21.5-6.986l295.186,122.908z "). attr ({stroke: "#666", opacity:. 3, "Stroke-width": 10}),
p = R.path (' M 20,170 c130,40,180,150,260,190 z '). attr ({stroke: "#666", opacity:. 3, "Stroke-width": 10});
over = R.path (). attr ({stroke: "#fff"}),
Len = P.gettotallength (),
Moving Dots
E = r.ellipse (0, 0, 7, 3). attr ({stroke: "None", Fill: "#a34e37"}). Onanimation (function () {
var t = this.attr ("transform");
Over.attr ({path: "m316,248l" + t[0][1] + "," + t[0][2] + "Z"});
});
R.circle (248, 5). attr ({stroke: "None", Fill: "#fff"});
R.customattributes.along = function (v) {
var point = p.getpointatlength (v * len);
return {
Transform: "T" + [Point.x, Point.y] + "r" + Point.alpha
};
};
E.attr ({along:0});
var Rotatealongthepath = true;
function Run () {
E.animate ({along:1}, 2e3, function () {
E.attr ({along:0});
SetTimeout (run);
});
}
Run ();
Logo
});
</script>
<body>
<div id= "Holder" style= "Background-color: #f0f0f0;" ></div>
</body>
Raphael target points moving continuously along the path