2011-10-11 4 views

답변

2

편집 : joshuanhibbert의 답변이 더 우아합니다. 그걸 써.

$("#ball").bind("webkitAnimationEnd oAnimationEnd msAnimationEnd animationend", function(){ 
    $(this).addClass("infinite"); 
}); 

그리고 당신의 CSS

#ball.infinite { 
    -webkit-animation: second 1s ease-in 0 infinite alternate; 
    -moz-animation: second 1s ease-in 0 infinite alternate; 
    -o-animation: second 1s ease-in 0 infinite alternate; 
    -ms-animation: second 1s ease-in 0 infinite alternate; 
    animation: second 1s ease-in 0 infinite alternate; 
} 

JSfiddle : http://jsfiddle.net/K74TW/

+0

감사합니다, 그것을 작동합니다! Mozilla에서 단순히 mozAnimationEnd로 변경 하시겠습니까? –

+0

모질라의 버전은 animationend입니다. 나는 오페라가 애니메이션을 지원할 때 미래의 증명에 대한 답을 편집했고, 언젠가는 언젠가 역시 IE를 원한다. – Duopixel

+0

감사합니다. 작동합니다! –