gpt4 book ai didi

javascript - 如何用raphael js绘制曲线?

转载 作者:行者123 更新时间:2023-11-28 02:47:37 24 4
gpt4 key购买 nike

我想在 5 秒内绘制一个像 M114,100c0,50 100-50 100,0c0,50 -100-50 -100Shape,该怎么做与拉斐尔·js 一起?

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Raphaël · Gear</title>
<style type="text/css">
body{overflow-x:hidden;overflow-y:scroll;width:100%;padding:0;margin:0;background-color:#022d00;}
</style>
<script src="raphael-min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
window.onload = function () {
var paper = Raphael(0, 0, 500, 600);
var path1=paper.path("M114 253").attr({"stroke": "#999", "stroke-width":1});

path1.animate({path: "M114,100c0,50 100-50 100,0c0,50 -100-50 -100"},5000).attr({"stroke": "#999", "stroke-width":1});
});
}
</script>
</head>
<body>
<div id="stroke"></div>
</body>
</html>

最佳答案

取出路径1的一批属性

var path1=paper.path("M114 253")

path1.animate({path: "M114,100c0,50 100-50 100,0c0,50 -100-50 -100"},5000).attr({"stroke": "#999", "stroke-width":1});

var path1=paper.path("M114 253").attr({"stroke": "#999", "stroke-width":1});      

path1.animate({path: "M114,100c0,50 100-50 100,0c0,50 -100-50 -100"},5000);

对我有用。

关于javascript - 如何用raphael js绘制曲线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4510726/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com