【发布时间】:2015-07-12 20:07:00
【问题描述】:
我刚刚开始使用 Velocity.js,并正在尝试制作一个简单的动画,将圆圈的颜色从红色变为黄色。我拥有的 HTML 只是...
<!DOCTYPE html>
<html>
<head>
<link href="https://code.jquery.com/ui/1.9.2/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="https://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="https://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="//cdn.jsdelivr.net/velocity/1.2.2/velocity.min.js"></script>
<script src="//cdn.jsdelivr.net/velocity/1.2.2/velocity.ui.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<svg height=300 width=300>
<circle id="example" cx=50 cy=50 r=20 fill="red"></circle>
</svg>
</body>
</html>
...我正在尝试在我的 JavaScript 中将圆圈的颜色更改为黄色,如下所示:
$('#example')
.delay(1000)
.velocity({fill: "yellow"});
我做错了什么?
【问题讨论】:
标签: javascript jquery svg jquery-animate velocity.js