2013-06-24 20 views
1

這個簡單的CSS動畫過渡工作鉻(27),但在Firefox(21)直接跳轉到最後。 類通過js按順序應用。 刪除translateZ修復了Firefox的動畫,但我認爲它禁用了硬件加速。 問題是,可能是一個FF錯誤或CSS是錯誤的?火狐問題與規模和硬件加速轉型

這裏小提琴http://jsfiddle.net/geedmo/zUQax/

* { 
    transform: translateZ(0px); 
    -webkit-transform: translateZ(0px); 
} 
.box { 
    position: absolute; 
    width: 100px; 
    height: 100px; 
    background: red; 
    transition: all .2s ease; 
} 
.box.scale { 
    transform: scale(1); 
    -webkit-transform: scale(1); 
} 
.box.scale.now { 
    transform: scale(0); 
    -webkit-transform: scale(0); 
} 
// JS 
$('.box').click(function() { 
    $(this).addClass('scale') 
    this.offsetWidth 
    $(this).addClass('now') 
}) 

回答

0

SOLUTION:

縮放爲非零值,但小到足以隱藏項目,做工精細的Firefox(23)。

.box.scale.now { 
    transform: scale(0.001); 
    -webkit-transform: scale(0.001); 
} 

它將如果有人知道爲什麼會發生

理解