jQuery动画SVG元素 [英] jQuery animate SVG element

查看:111
本文介绍了jQuery动画SVG元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序中出现了svg.喜欢

I got a svg in my application. Like

<svg id="gt" height="450" width="300" xmlns="http://www.w3.org/2000/svg">
<image id="1_dice" x="0" y="420" height="30" width="30" xlink:href="images/1_coin.png" />
</svg>

我得到了一个名为'1_dice'的svg元素.在HTML按钮中,单击我想根据参数对元素进行动画处理".喜欢

I got a svg element named '1_dice'. In a HTML button click I would likes to animate the element according to the parameters. Like

$('#btn').click(function(){
     $('#1_dice').animate({'x':200},2000);
});

我尝试了这个,但这不起作用...

I tried this but this doesn't working ...

推荐答案

jQuery animate用于动画HTML元素. 对于SVG,您必须尝试 jQuery SVG 插件. 请点击链接- http://keith-wood.name/svg.html

jQuery animate is for animating HTML elements. For SVG you have to try jQuery SVG plugin. Please follow the link - http://keith-wood.name/svg.html

这篇关于jQuery动画SVG元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆