私のコード:
$(document).ready(function () {
// Creates canvas 800 × 800 at 30, 50
var paper = Raphael(30, 50, 800, 800);
$(document).click(function () {
create(paper);
});
function create(paper) {
// Creates circle at x = 250, y = 100, with radius 50
var circle = paper.circle(250, 100, 50);
// Sets the fill attribute of the circle to red (#f00)
circle.attr("fill", "#f00");
// Sets the stroke attribute of the circle to white
circle.attr("stroke", "#EEE");
circle.animate({ transform: "r" + 180 }, 1000);
}
});
ドキュメントをクリックすると円を作成できます。Raphael.js を使用して、動的な場所でページ上のフライング アニメーションをクリックして、さまざまな色の円オブジェクトを作成するコードを教えてください。