문제

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?

도움이 되었습니까?

해결책

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();
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top