Question

I am most likely misusing this call back feature but in the following code, the "testCircle" performs no animation before disappearing.

var paper = Raphael(0, 0, 1280,600);


    var testCircle = paper.circle(300, 300, 50);

    testCircle.animate({
        cx: 700
    }, 1000, testCircle.remove())

I want the animation to actually finish before the circle is removed. Am I misusing this function?

Was it helpful?

Solution

Here you go: DEMO

var paper = Raphael(0, 0, 1280,600);
var testCircle = paper.circle(300, 300, 50).attr('fill','red');

testCircle.animate({cx: 700}, 1000, hideCircle);

function hideCircle()
{
    testCircle.remove();
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top