這可以在這裏測試:http://jsfiddle.net/rGECn/2/在Linux下的Firefox 15.0.1中未觸發transitionend事件
是否有解決此問題的解決方法?
更新1:
'transitionend
在window`返回false。
這可以在這裏測試:http://jsfiddle.net/rGECn/2/在Linux下的Firefox 15.0.1中未觸發transitionend事件
是否有解決此問題的解決方法?
更新1:
'transitionend
在window`返回false。
您錯過了CSS中的一些供應商前綴。
button {
width: 100px;
-moz-transition: all 1s;
-o-transition: all 1s;
-webkit-transition: all 1s;
transition: all 1s;
}
根據這一compat table,transition
s的只有IE10支持,所以我會建議使用jQuery的animate
方法,跨瀏覽器的解決方案:
$('button').click(function() {
var toggle = [100, 150],
$this = $(this),
c = $this.data('count') + 1;
$this.data('count', c);
$this.stop(true).animate({'width': toggle[c % toggle.length]}, 1000, function() {
//done callback
count();
});
}).data('count', 0);
取出.stop(true)
如果您想排隊動畫而不是在用戶點擊動畫時點擊動畫。
Fabicio,看起來像問題是與我正在使用的越野車庫:http://www.paulrhayes.com/2011-11/use-css-transitions-to-link-media-queries-and-javascript/。我必須進一步調查。無論如何,感謝您的幫助。 – Behrang
我明白了。沒問題。 '=]' –
在Firefox 15.0.1下爲Ubuntu 12.04 64位工作。 – Ken
也許如果你添加'-moz'? http://jsfiddle.net/rGECn/43/ –
沒有供應商前綴的'transition:all 1s;'在FF18 Nightly for Windows 7 64位上也可以工作。 –