首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SVG.js :形状扩展:动画错误

SVG.js :形状扩展:动画错误
EN

Stack Overflow用户
提问于 2017-05-01 17:30:43
回答 1查看 105关注 0票数 0

下面是一个使用SVG.js形状扩展创建星型的示例。当我请求将它从7点(尖峰)动画到10点(尖峰)时,它会产生一个错误。

有什么想法吗?

代码语言:javascript
复制
<!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>

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-05-05 09:20:13

所以我找到了时间来更新这个扩展。它可以在保龄球和一旦一揽子-冲突解决的国家预防机制,也。

它现在需要svg.js的第2版,并且完全按照您指定的方式工作。

代码语言:javascript
复制
mySVG
  .polygon()
  .ngon()
  .animate()
  .star()
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43723512

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档