css3動畫之1--animation小例子

來源:互聯網
上載者:User

標籤:style   blog   http   color   os   io   strong   for   

1.首先看效果


2、代碼及分析
 <style type="text/css">        #div1        {             margin:100px;            position: absolute;            text-align: center;            background: #abcdef;             width: 300px;            height: 20px;            line-height: 20px;        }        @-webkit-keyframes move{    0%    {        -webkit-transform:translateY(0px)    }            100%    {        -webkit-transform:translateY(-15px)    }}#div1 span:nth-of-type(1){  -webkit-animation:.5s move alternate infinite; }#div1 span:nth-of-type(2){  -webkit-animation:.5s .1s move alternate infinite;}#div1 span:nth-of-type(3){  -webkit-animation:.5s .2s move alternate infinite;}#div1 span:nth-of-type(4){  -webkit-animation:.5s .3s move alternate infinite;}#div1 span:nth-of-type(5){  -webkit-animation:.5s .4s move alternate infinite;}#div1 span:nth-of-type(6){  -webkit-animation:.5s .5s move alternate infinite;}#div1 span:nth-of-type(7){  -webkit-animation:.5s .6s move alternate infinite;}#div1 span:nth-of-type(8){  -webkit-animation:.5s .7s move alternate infinite;}     </style></head><body>    <div id="div1"> <span>正</span> <span>在</span> <span>加</span> <span>載</span> <span>中</span><span>.</span><span>.</span><span>.</span>            </div></body>
------------------------------------------------------------------------------
alternate infinite alternate:動畫迴圈執行,infinite:執行無限次 
--分析:1、按照順序的執行,也就是說延遲時間會逐漸增加
解釋:  -webkit-animation:.5s/*執行時間*/ .1s/*延遲時間*/ move alternate infinite;} 
查看效果(建議用Chrome瀏覽器):
http://www.tuzizjf.com/project/css30812.html

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.