簡體   English   中英

SVG.js:形狀擴展:動畫錯誤

[英]SVG.js : Shapes extension: animate error

以下是使用SVG.js形狀擴展名創建星形的示例。 當我請求將動畫從7點(尖峰)設置為10點(尖峰)時,會生成錯誤。

有任何想法嗎?

 <!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> 

因此,我找到了更新此擴展程序的時間。 它可以在bower上使用,一旦在npm上解決了軟件包沖突,也可以使用。

現在,它需要svg.js的版本2,並且可以完全按照您指定的方式工作

mySVG
  .polygon()
  .ngon()
  .animate()
  .star()

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM