![](/img/trans.png)
[英]CSS animation : move a div with the new position relative to the previous
[英]Use css to move div to a new location then stop there
是否有一種純CSS方法將div從一個位置移動到另一個位置並停止。 我所擁有的跳回到原來的地方。
#animate {
position: absolute;
top: 0px;
left: 0px;
animation: move 3s ease;
}
@keyframes move {
from { transform: translateX(0px); }
to { transform: translateX(500px); }
}
如果我為此需要JS,是否有辦法在動畫的結尾處進行條件處理,而不是隨超時移動它?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.