CSS3動畫和過渡事件的監控

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);



參考文章:
http://www.web-tinker.com/article/20338.html https://developer.mozilla.org/zh-CN/docs/CSS/Tutorials/Using_CSS_transitions http://www.cnblogs.com/duanhuajian/archive/2013/01/29/2881973.html
相關文章
相關標籤/搜索