javascript webkitTransitionEnd 不触发
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15103949/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
webkitTransitionEnd not firing
提问by mikew
I'm not sure what exactly happened, but I am pretty sure this was working at one point.
我不确定到底发生了什么,但我很确定这在某一时刻有效。
The event just isn't firing (or I am not catching it properly)
事件没有触发(或者我没有正确捕捉它)
var $zoomBox = $('#zoomBox');
$zoomBox.bind('webkitTransitionEnd', function(e) {
alert("test");
});
$('.button').click(function (e) {
$zoomBox.css('-webkit-transform', 'matrix(2,1,1,2,300, 100)');
});
see fiddle below. After the box finishes transitioning, an alert should pop up, but the alert is not displaying.
见下面的小提琴。框完成转换后,应弹出警报,但未显示警报。
回答by jfriend00
There's no transition specified in the CSS, so you aren't getting a transition at all. You're just changing the CSS for which there is no webkitTransitionEnd
event.
CSS 中没有指定过渡,因此您根本没有获得过渡。您只是在更改没有webkitTransitionEnd
事件的 CSS 。
See the fixed example here (in Chrome or Safari): http://jsfiddle.net/jfriend00/75Mh2/where I've added:
请参阅此处的固定示例(在 Chrome 或 Safari 中):http: //jsfiddle.net/jfriend00/75Mh2/,其中我已添加:
-webkit-transition: -webkit-transform 3s;