欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

一款基于css3和jquery實現(xiàn)的動畫顯示彈出層按鈕教程

  發(fā)布時間:2015-01-04 10:02:47   作者:佚名   我要評論
這款彈出層初頁面面一個顯示彈出層按鈕。單擊該按鈕時,彈出層以非常炫的動畫形式出現(xiàn)。彈出層有關(guān)閉按鈕,單擊半閉按鈕,彈出層關(guān)閉。下面分享這款基于css3和jquery實現(xiàn)的動畫顯示彈出層按鈕教程,需要的朋友可以參考下

  今天給大家分享一款基于css3和jquery實現(xiàn)的動畫彈出層。這款彈出層初頁面面一個顯示彈出層按鈕。單擊該按鈕時,彈出層以非常炫的動畫形式出現(xiàn)。彈出層有關(guān)閉按鈕,單擊半閉按鈕,彈出層關(guān)閉。效果圖如下:

  實現(xiàn)的代碼。

  html代碼:

XML/HTML Code復(fù)制內(nèi)容到剪貼板
  1. <div class="papersheet">  
  2.         <!-- Action Trigger -->  
  3.         <div class="papersheet__trigger">  
  4.             <!-- Icon -->  
  5.             <svg class="papersheet__trigger-icon" viewbox="0 0 24 24"><g transform="scale(0.023 0.023)"><path d="M1014.662 822.66c-0.004-0.004-0.008-0.008-0.012-0.010l-310.644-310.65 310.644-310.65c0.004-0.004 0.008-0.006 0.012-0.010 3.344-3.346 5.762-7.254 7.312-11.416 4.246-11.376 1.824-24.682-7.324-33.83l-146.746-146.746c-9.148-9.146-22.45-11.566-33.828-7.32-4.16 1.55-8.070 3.968-11.418 7.31 0 0.004-0.004 0.006-0.008 0.010l-310.648 310.652-310.648-310.65c-0.004-0.004-0.006-0.006-0.010-0.010-3.346-3.342-7.254-5.76-11.414-7.31-11.38-4.248-24.682-1.826-33.83 7.32l-146.748 146.748c-9.148 9.148-11.568 22.452-7.322 33.828 1.552 4.16 3.97 8.072 7.312 11.416 0.004 0.002 0.006 0.006 0.010 0.010l310.65 310.648-310.65 310.652c-0.002 0.004-0.006 0.006-0.008 0.010-3.342 3.346-5.76 7.254-7.314 11.414-4.248 11.376-1.826 24.682 7.322 33.83l146.748 146.746c9.15 9.148 22.452 11.568 33.83 7.322 4.16-1.552 8.070-3.97 11.416-7.312 0.002-0.004 0.006-0.006 0.010-0.010l310.648-310.65 310.648 310.65c0.004 0.002 0.008 0.006 0.012 0.008 3.348 3.344 7.254 5.762 11.414 7.314 11.378 4.246 24.684 1.826 33.828-7.322l146.746-146.748c9.148-9.148 11.57-22.454 7.324-33.83-1.552-4.16-3.97-8.068-7.314-11.414z"></path></g></svg>  
  6.         </div>  
  7.         <!-- Face 1 -->  
  8.         <div class="papersheet__face-item animated fadeInUp">  
  9.             <img src="128.jpg" alt="" />  
  10.         </div>  
  11.         <!-- Face 2 -->  
  12.         <div class="papersheet__face-item animated fadeInUp">  
  13.             <img src="129.jpg" alt="" />  
  14.         </div>  
  15.         <!-- Face 2 -->  
  16.         <div class="papersheet__face-item animated fadeInUp">  
  17.             <img src="130.jpg" alt="" />  
  18.         </div>  
  19.     </div>  
  20.     <script src='jquery.js'></script>  
  21.     <script>  
  22.         _papersheet = $('.papersheet');   
  23.         _trigger = $('.papersheet__trigger');   
  24.         _trigger.click(function () {   
  25.             if (_papersheet.hasClass('opened')) {   
  26.                 $(this).parent('.papersheet').stop().removeClass('opened');   
  27.             } else {   
  28.                 $(this).parent('.papersheet').stop().addClass('opened');   
  29.             }   
  30.         });   
  31.         //@ sourceURL=pen.js   
  32.     </script>  

  css3代碼:

CSS Code復(fù)制內(nèi)容到剪貼板
  1. @import url("http://daneden.github.io/animate.css/animate.min.css");   
  2.         :root   
  3.         {   
  4.             width: 100%;   
  5.             height: 100%;   
  6.         }   
  7.         body   
  8.         {   
  9.             width: 100%;   
  10.             height: 100%;   
  11.             display: -webkit-flex;   
  12.             display: -ms-flexbox;   
  13.             display: flex;   
  14.             -webkit-align-items: center;   
  15.             -ms-flex-align: center;   
  16.             align-items: center;   
  17.             -webkit-justify-contentcenter;   
  18.             -ms-flex-pack: center;   
  19.             justify-contentcenter;   
  20.             overflowhidden;   
  21.             background-color#263238;   
  22.         }   
  23.         .papersheet   
  24.         {   
  25.             positionrelative;   
  26.             overflowhidden;   
  27.             text-aligncenter;   
  28.             -moz-box-sizing: border-box;   
  29.             box-sizing: border-box;   
  30.             -webkit-transition: all 200ms;   
  31.             transition: all 200ms;   
  32.             width: 100%;   
  33.             height: 100%;   
  34.             max-width: 50%;   
  35.             min-width: 50rem;   
  36.             max-height: 50%;   
  37.             min-height: 20rem;   
  38.             margin: 0 auto;   
  39.             display: -webkit-flex;   
  40.             display: -ms-flexbox;   
  41.             display: flex;   
  42.             -webkit-align-items: center;   
  43.             -ms-flex-align: center;   
  44.             align-items: center;   
  45.             -webkit-justify-contentcenter;   
  46.             -ms-flex-pack: center;   
  47.             justify-contentcenter;   
  48.         }   
  49.         .papersheet.opened   
  50.         {   
  51.             -webkit-transition: all 900ms;   
  52.             transition: all 900ms;   
  53.             box-shadow: 0px 5px 20px rgba(0, 0, 0, 0.5);   
  54.         }   
  55.         .papersheet__trigger   
  56.         {   
  57.             z-index: 1;   
  58.             displayinline-block;   
  59.             padding: 2rem;   
  60.             border-radius: 50%;   
  61.             positionabsolute;   
  62.             background-colortransparent;   
  63.             top: 50%;   
  64.             left: 50%;   
  65.             -webkit-transform: translate(-50%, -50%);   
  66.             -ms-transform: translate(-50%, -50%);   
  67.             transform: translate(-50%, -50%);   
  68.             -webkit-transition: all 800ms cubic-bezier(0.19, 1, 0.22, 1);   
  69.             transition: all 800ms cubic-bezier(0.19, 1, 0.22, 1);   
  70.             cursorpointer;   
  71.         }   
  72.         .opened .papersheet__trigger   
  73.         {   
  74.             background-color#eceff1;   
  75.             top: 10%;   
  76.         }   
  77.         .papersheet__trigger:hover   
  78.         {   
  79.             box-shadow: 0px 5px 20px rgba(0, 0, 0, 0.5);   
  80.         }   
  81.         .papersheet__trigger:active:before   
  82.         {   
  83.             background-color#d5d5d5;   
  84.         }   
  85.         .papersheet__trigger:before   
  86.         {   
  87.             content"";   
  88.             background-color#eceff1;   
  89.             displayblock;   
  90.             positionabsolute;   
  91.             border-radius: 50%;   
  92.             top: 50%;   
  93.             left: 50%;   
  94.             bottombottom: 50%;   
  95.             rightright: 50%;   
  96.             width: 6rem;   
  97.             height: 6rem;   
  98.             z-index: 0;   
  99.             pointer-events: none;   
  100.             -webkit-transform: translate(-50%, -50%);   
  101.             -ms-transform: translate(-50%, -50%);   
  102.             transform: translate(-50%, -50%);   
  103.             -webkit-transition-delay: 2s;   
  104.             transition-delay: 2s;   
  105.             -webkit-transition: all 400ms cubic-bezier(0.165, 0.84, 0.44, 1);   
  106.             transition: all 400ms cubic-bezier(0.165, 0.84, 0.44, 1);   
  107.         }   
  108.         .opened .papersheet__trigger:before   
  109.         {   
  110.             width3000px;   
  111.             height3000px;   
  112.             -webkit-transition: all 2.5s cubic-bezier(0.165, 0.84, 0.44, 1);   
  113.             transition: all 2.5s cubic-bezier(0.165, 0.84, 0.44, 1);   
  114.         }   
  115.         .papersheet__trigger-icon  
  116.         {   
  117.             fill: #37474f;   
  118.             vertical-alignbottombottom;   
  119.             -webkit-transform: rotate(45deg);   
  120.             -ms-transform: rotate(45deg);   
  121.             transform: rotate(45deg);   
  122.             -webkit-transition: all 800ms cubic-bezier(0.19, 1, 0.22, 1);   
  123.             transition: all 800ms cubic-bezier(0.19, 1, 0.22, 1);   
  124.             -webkit-transition-delay: 50ms;   
  125.             transition-delay: 50ms;   
  126.             width: 1.8rem;   
  127.             height: 1.8rem;   
  128.         }   
  129.         .opened .papersheet__trigger-icon  
  130.         {   
  131.             -webkit-transform: rotate(-360deg);   
  132.             -ms-transform: rotate(-360deg);   
  133.             transform: rotate(-360deg);   
  134.         }   
  135.         .papersheet__face-item   
  136.         {   
  137.             border-radius: 50%;   
  138.             margin: 0 1.5rem;   
  139.             z-index: 1;   
  140.             height: 6rem;   
  141.             width: 6rem;   
  142.             displaynone;   
  143.             overflowhidden;   
  144.         }   
  145.         .papersheet__face-item:nth-child(2)   
  146.         {   
  147.             -webkit-animation-delay: 50ms;   
  148.             animation-delay: 50ms;   
  149.         }   
  150.         .papersheet__face-item:nth-child(3)   
  151.         {   
  152.             -webkit-animation-delay: 150ms;   
  153.             animation-delay: 150ms;   
  154.         }   
  155.         .papersheet__face-item:nth-child(4)   
  156.         {   
  157.             -webkit-animation-delay: 250ms;   
  158.             animation-delay: 250ms;   
  159.         }   
  160.         .papersheet__face-item img   
  161.         {   
  162.             max-width: 100%;   
  163.         }   
  164.         .opened .papersheet__face-item   
  165.         {   
  166.             -webkit-transform: translateX(60%);   
  167.             -ms-transform: translateX(60%);   
  168.             transform: translateX(60%);   
  169.             displayblock;   
  170.         }  

相關(guān)文章

  • CSS3 最強二維布局系統(tǒng)之Grid 網(wǎng)格布局

    CS3的Grid網(wǎng)格布局是目前最強的二維布局系統(tǒng),可以同時對列和行進行處理,將網(wǎng)頁劃分成一個個網(wǎng)格,可以任意組合不同的網(wǎng)格,做出各種各樣的布局,本文介紹CSS3 最強二維布局系
    2025-02-27
  • 如何使用CSS3實現(xiàn)波浪式圖片墻

    本文介紹了如何使用CSS3的transform屬性和動畫技巧實現(xiàn)波浪式圖片墻,通過設(shè)置圖片的垂直偏移量,并使用動畫使其周期性地改變位置,可以創(chuàng)建出動態(tài)且具有波浪效果的圖片墻,同
    2025-02-27
  • CSS3模擬實現(xiàn)一個雷達探測掃描動畫特效(最新推薦)

    文章介紹了如何使用CSS3實現(xiàn)一個雷達探測掃描的效果,包括夜色背景、蜘蛛網(wǎng)盤、掃描體的轉(zhuǎn)動效果、尾巴陰影以及被掃描到的光點,通過HTML和CSS的配合,實現(xiàn)了豐富的動畫效果,
    2025-02-21
  • css3 display:flex 彈性盒模型的使用方法

    CSS3的Flexbox是一種強大的布局模式,通過設(shè)置display:flex可以輕松實現(xiàn)對齊、排列和分布網(wǎng)頁元素,它解決了傳統(tǒng)布局方法中的對齊、間距分配和自適應(yīng)布局等問題,接下來通過本
    2025-02-19
  • css3 實現(xiàn)icon刷新轉(zhuǎn)動效果

    本文給大家介紹css3 實現(xiàn)icon刷新轉(zhuǎn)動效果,文章開頭給大家介紹了webkit-transform、animation、@keyframes這三個屬性,結(jié)合實例代碼給大家介紹的非常詳細(xì),感興趣的朋友一
    2025-02-19
  • CSS3動態(tài)效果之過渡屬性(最新推薦)

    CSS3過渡屬性用于實現(xiàn)元素從一種樣式平滑過渡到另一種樣式,通過設(shè)置transition-property過渡屬性、transition-duration過渡時長transition-timing-function過渡函數(shù)和trans
    2025-02-19
  • CSS3實現(xiàn)動態(tài)旋轉(zhuǎn)加載樣式的示例代碼

    本文介紹了如何使用CSS3創(chuàng)建一個簡單的動態(tài)旋轉(zhuǎn)加載樣式,通過定義一個帶有類名“l(fā)oader”的HTML元素,并使用CSS樣式和@keyframes規(guī)則來實現(xiàn)旋轉(zhuǎn)動畫,你可以根據(jù)需要調(diào)整樣式
    2025-02-19
  • 使用CSS3實現(xiàn)平滑的過渡動畫效果(實例代碼)

    這篇文章主要介紹了如何使用CSS3的transition屬性實現(xiàn)平滑的過渡動畫,本文通過實例代碼給大家介紹的非常詳細(xì),感興趣的朋友一起看看吧
    2025-02-13
  • CSS3中使用flex和grid實現(xiàn)等高元素布局的示例代碼

    本文介紹了使用CSS3中的Flexbox和Grid布局實現(xiàn)等高元素布局的方法,通過簡單的兩列實現(xiàn)、每行放置3列以及全部代碼的展示,展示了這兩種布局方式的實現(xiàn)細(xì)節(jié)和效果,感興趣的朋
    2025-02-11
  • 使用CSS3和SVG創(chuàng)建圓形進度條動畫效果

    CSS3和SVG的結(jié)合使用為網(wǎng)頁設(shè)計帶來了創(chuàng)新的動態(tài)視覺效果,本文通過一個圓形進度條的動畫特效示例,展示了如何利用CSS3的動畫功能和SVG的矢量圖形能力來創(chuàng)建豐富的用戶交互體
    2024-10-24

最新評論