BigOrinj
BigOrinj

Reputation: 243

Multiple Canvas Animations

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.?

Upvotes: 2

Views: 720

Answers (2)

btevfik
btevfik

Reputation: 3431

i think i like user1823799's answer better. but here is my solution to it. i basically added another canvas and context and in the same function i am checking for whether if the second arc reached its limit.

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

Upvotes: 0

user1823799
user1823799

Reputation: 120

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.

Upvotes: 3

Related Questions