0
我正在嘗試使用CSS進行摺疊。我做了這樣的事情,但它不起作用。我認爲是動態高度問題,因爲當我在px中添加高度時,一切都是有效的。我該怎麼辦?CSS:從 - >到百分比高度的關鍵幀
@-moz-keyframes collapseIn {
from {height: 0%;}
to {height: 100%;}
}
@-webkit-keyframes collapseIn {
from {height: 0%;}
to {height: 100%;}
}
@keyframes collapseIn {
from {height: 0%;}
to {height: 100%;}
}
@-moz-keyframes collapseOut {
from {height: 100%;}
to {height: 0%;}
}
@-webkit-keyframes collapseOut {
from {height: 100%;}
to {height: 0%;}
}
@keyframes collapseOut {
from {height: 100%;}
to {height: 0%;}
}
.collapseCSS.ng-enter {
-webkit-animation: collapseIn 1s;
-moz-animation: collapseIn 1s;
animation: collapseIn 1s;
}
.collapseCSS.ng-leave {
-webkit-animation: collapseOut 1s;
-moz-animation: collapseOut 1s;
animation: collapseOut 1s;
}
尋求代碼幫助的問題必須包含在問題本身**中重現它所需的最短代碼**最好在[** Stack Snippet **](https://blog.stackoverflow.com/2014/09 /引入可運行的JavaScript-CSS-和HTML的代碼段/)。請參閱[**如何創建一個最小化,完整和可驗證的示例**](http://stackoverflow.com/help/mcve) –
也就是說,您不能對未設置或未設置的高度進行動畫製作設置爲'auto'。 –