1. 程式人生 > >css3動畫速度曲線

css3動畫速度曲線

語法一

animation-timing-function: value;

value:
linear 動畫從頭到尾的速度是相同的。
ease 預設。動畫以低速開始,然後加快,在結束前變慢。
ease-in 動畫以低速開始。
ease-out 動畫以低速結束。
ease-in-out 動畫以低速開始和結束。
cubic-bezier(n,n,n,n) 在 cubic-bezier 函式中自己的值。可能的值是從 0 到 1 的數值

語法二

  <style>
    .animation {
      width: 50px;
      height
: 50px
; background-color: #ed3; -webkit-transition: all 2s; -o-transition: all 2s; transition: all 2s; }
.animation:hover { -webkit-transform: translateX(100px) cubic-bezier(.17, .86, .73, .14);; -ms-transform: translateX(100px) cubic-bezier(.17
, .86, .73, .14)
;; -o-transform: translateX(100px) cubic-bezier(.17, .86, .73, .14);; transform: translateX(100px) cubic-bezier(.17, .86, .73, .14);; }
</style>