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?

Était-ce utile?

La 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();
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top