css3控制多重動畫效果

來源:互聯網
上載者:User

標籤:css3   transform   transition   動畫   

今天看到一個類似於門窗開關效果。想著用css3實現,當然js是可以必須能夠實現的。我主要想體驗一把css3的神奇。

0102


01圖片縮小,縮小到看不到之後,出現02圖片放大的效果。

實現原理:用一個外層div來觸發hover效果,裡面套兩個圖片div,

分別為圖一和圖二

主要使用css3的transform和transition效果,而且比較重點的是transition-delay延時屬性。

具體代碼

html--------------------------

 <div id="out">      <div id="in1"> <img src="./images/990ad_01.jpg"></div>      <div id="in2"> <img src="./images/990ad_03.jpg"></div>    </div>
css部分---------------------------------------

 #out{width:321px; height:339px; overflow:hidden; position:relative;}    #in1{float:left;}    #in2{display:block; float:left;transform:scale(0,1);}    #out:hover #in1{transform:scale(0,1); transition:all 0.5s linear;}    #out:hover #in2{transition:all 0.3s linear 0.35s;transform:scale(1,1);    display:block; float:left; position:absolute; top:0px; left:0px;}




聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.