我的代码:
$(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 在动态位置在页面上点击飞行动画创建具有不同颜色的圆形对象的代码