Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
334 views
in Technique[技术] by (71.8m points)

javascript - CSS3过渡事件(CSS3 transition events)

元素是否触发了任何事件来检查css3转换是否已开始或结束?

  ask by Andreas K?berle translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

W3C CSS Transitions Draft(W3C CSS过渡草案)

The completion of a CSS Transition generates a corresponding DOM Event.

(CSS Transition的完成将生成相应的DOM事件。)

An event is fired for each property that undergoes a transition.

(将为每个经历过渡的属性触发一个事件。)

This allows a content developer to perform actions that synchronize with the completion of a transition.

(这允许内容开发人员执行与转换完成同步的动作。)


Webkit(网页套件)

To determine when a transition completes, set a JavaScript event listener function for the DOM event that is sent at the end of a transition.

(要确定转换何时完成,请为在转换结束时发送的DOM事件设置JavaScript事件监听器函数。)

The event is an instance of WebKitTransitionEvent, and its type is webkitTransitionEnd .

(该事件是WebKitTransitionEvent的实例,其类型为webkitTransitionEnd 。)

box.addEventListener( 'webkitTransitionEnd', 
    function( event ) { alert( "Finished transition!" ); }, false );

Mozilla(Mozilla)

There is a single event that is fired when transitions complete.

(转换完成时会触发一个事件。)

In Firefox, the event is transitionend , in Opera, oTransitionEnd , and in WebKit it is webkitTransitionEnd .

(在Firefox中,事件是transitionend ,在Opera中是oTransitionEnd ,在WebKit中是webkitTransitionEnd 。)

Opera(歌剧)

There is one type of transition event available.

(有一种类型的过渡事件可用。)

The oTransitionEnd event occurs at the completion of the transition.

(oTransitionEnd事件在转换完成时发生。)

Internet Explorer(IE浏览器)

The transitionend event occurs at the completion of the transition.

(transitionend事件发生在转换完成时。)

If the transition is removed before completion, the event will not fire.

(如果在完成之前删除过渡,则不会触发该事件。)


Stack Overflow: How do I normalize CSS3 Transition functions across browsers?

(堆栈溢出:如何在浏览器之间规范CSS3 Transition功能?)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...