Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery SVG动画没有方法_Jquery_Svg_Jquery Animate_Transform - Fatal编程技术网

Jquery SVG动画没有方法

Jquery SVG动画没有方法,jquery,svg,jquery-animate,transform,Jquery,Svg,Jquery Animate,Transform,我有一个SVG(html): 但我一直在控制台中看到错误: TypeError: Object #<SVGCircleElement> has no method 'animate' arguments: Array[2] get message: function () { [native code] } get stack: function () { [native code] } set message: function () { [native code] } set s

我有一个SVG(html):

但我一直在控制台中看到错误:

TypeError: Object #<SVGCircleElement> has no method 'animate'
arguments: Array[2]
get message: function () { [native code] }
get stack: function () { [native code] }
set message: function () { [native code] }
set stack: function () { [native code] }
type: "undefined_method"
__proto__: Error
TypeError:对象#没有“动画”方法
参数:数组[2]
获取消息:函数(){[本机代码]}
获取堆栈:函数(){[本机代码]}
设置消息:函数(){[本机代码]}
设置堆栈:函数(){[本机代码]}
类型:“未定义的_方法”
__原型:错误

我是否需要安装插件或库来制作SVG动画?我以为你能做到这一点?如果是这样的话,我希望能有一个正确的方向….

实际上您使用的是
DOM
对象,而不是
jquery
对象。这样试试

 $('#radius-ring').animate({fill: "#223fa3", stroke: "#000", "stroke-width": 80, "stroke-opacity": 0.5}, 2000);
而不是

 $('#radius-ring')[0].animate({fill: "#223fa3", stroke: "#000", "stroke-width": 80, "stroke-opacity": 0.5}, 2000);

实际上,您使用的是
DOM
对象,而不是
jquery
对象。这样试试

 $('#radius-ring').animate({fill: "#223fa3", stroke: "#000", "stroke-width": 80, "stroke-opacity": 0.5}, 2000);
而不是

 $('#radius-ring')[0].animate({fill: "#223fa3", stroke: "#000", "stroke-width": 80, "stroke-opacity": 0.5}, 2000);

我需要设置笔划宽度的动画,首先我尝试不使用引号。多亏了你,我知道引号是必要的。我需要设置笔划宽度的动画,首先我尝试不使用引号。多亏了你,我才明白引用是必要的。