【发布时间】:2014-04-08 01:26:13
【问题描述】:
我在覆盖 Firefox 上的转换延迟时遇到问题。下面的示例在 Chrome 和 IE 中按我的预期工作,但在 Firefox 中,在动画之前它会延迟。在动画开始之前,我无法覆盖 Firefox 上的转换延迟。我相信这是一个错误,但是这个问题的解决方法是什么?
这里是 HTML 代码
<button>move</button>
<div class="box"></div>
Javascript
$('button').click(function(){
$('.box').addClass('move').on('transitionend',function(){
$(this).removeClass('move');
});
});
和 CSS
.box{
height:100px;
width:100px;
background-color:yellow;
transition:all 1s ease 1s;
position:absolute;
left:0;
}
.move{
transition-delay:0;
left:500px;
}
【问题讨论】:
标签: javascript html css