0
下面是一個使用SVG.js形狀擴展在星形創建的示例。當我要求從7點(尖峯)到10點(尖峯)進行動畫處理時,會產生錯誤。SVG.js:形狀擴展:動畫錯誤
任何想法?
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SVG.js - Shapes Extension: animate error</title>
<script type="text/javascript" src="//svgDiscovery.com/SVG.js/svg.js"></script>
<script type="text/javascript" src="//svgDiscovery.com/SVG.js/Plugins/svg.shapes.js"></script>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width">
</head>
<body style='padding:10px;font-family:arial;'>
<center>
<h4>SVG.js - Shapes Extension: animate error</h4>
<table>
<tr>
<td>
<div id="svgDiv" style='background-color:lightgreen;width:400px;height:400px;'></div>
</td>
</tr></table>
<script id=myScript>
//---access the empty DIV---
var mySVG = SVG('svgDiv').size(400, 400);
var myStar = mySVG.polygon().attr({id:'myPolygon',stroke:'blue','stroke-width':3,fill:'yellow'}).star({
inner: 50
, outer: 100
, spikes: 7
}).move(100,100)
//---creates error---
myStar.animate().star({ spikes: 10 })
</script>
</body>
</html>
形狀插件不支持動畫作品完全相同。這是一個有趣的主意:) – Fuzzyma
@Fuzzyma實際上,此擴展名顯示了動畫支持。請參閱:https://github.com/svgdotjs/svg.shapes.js –
好的。我必須更仔細地研究這個,然後 – Fuzzyma