CSS3 包含主要動畫效果經過兩種方式實現:
動畫(animation)
過渡(transition) html
想要作這兩種動畫效果的開始和結束處觸發事件,完成相關功能,則須要用到相關的事件監控:
動畫(animation)
web
標準寫法:animationstart ,animationi teration(迭代,動畫重複的時候) ,animationend
Webkit寫法:webkitAnimationStart,webkitAnimationIteration (迭代,動畫重複的時候),webkitAnimationEnd過渡(transition)
標準寫法:transitionend
Webkit寫法:webkitTransitionEnd
例子: 動畫
document.getElementById("contentWrap").addEventListener("webkitTransitionEnd", function(){ alert(123); }, false);