我正在实现文章元素的CSS3过渡效果,但事件监听器transitionend只适用于纯JavaScript,而不适用于jQuery。CSS3转换事件监听器与jQuery
见下面的例子:
// this works
this.parentNode.addEventListener('transitionend', function() {alert("1"); }, true);
// this does not work
$(this).parent().addEventListener('transitionend', function() {alert("1"); }, true);
有人可以解释我什么我做错了吗?
要获得完整的兼容性,您还应该包含供应商前缀事件。参见http://blog.teamtreehouse.com/using-jquery-to-detect-when-css3-animations-and-transitions-end](http://blog.teamtreehouse.com/using-jquery-to-detect -when-css3-animations-and-transitions-end)以获取详细信息。 –