2

I have a fiddle of what I've achieved so far with Animating a Canvas.

http://jsfiddle.net/skerwin/uhVj6/6/

I'm trying to make a duplicate of the canvas, I want to change the amount it grows

Circle One:

var endPercent = 65;
var curPerc = 0;

Circle Two:

 var endPercent = 45;
 var curPerc = 0;

I'm really new to Jquery/Animations and Canvas. What do i have to do to duplicate the Animation code to make 2 Canvas' animate at the same time.?

4

2 回答 2

3

Maybe something like this? http://jsfiddle.net/dLAVe/ I wraped the code in a new animate function and changed the name of your animate function to render. The animate function now takes two arguments, the id of the element and the number of percentage.

于 2013-03-30T13:37:23.160 回答
0

我想我更喜欢 user1823799 的回答。但这是我的解决方案。我基本上添加了另一个canvascontext并且在同一个函数中,我正在检查第二个弧是否达到了极限。

http://jsfiddle.net/btevfik/6SuCC/

于 2013-03-30T13:45:58.067 回答