久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

代碼實現網頁左下角添加蒲公英飄動特效

225次閱讀
沒有評論

共計 1691 個字符,預計需要花費 5 分鐘才能閱讀完成。

網頁左下角有一個蒲公英飄動特效,相信很多站長都見過,為此,橘子君也做了一番研究,實現蒲公英飄動特效還是比較簡單。只需在網頁中加入以下代碼即可實現。如果是想全站展示,建議將特效代碼添加到 footer 文件中。

蒲公英特效代碼

<!-- 蒲公英特效 -->
    <div class="dandelion">
        <span class="smalldan"></span>
        <span class="bigdan"></span>
    </div>
     
    <style type="text/css">
    @media screen and (max-width:600px){.dandelion{display: none !important;}
    }
        .dandelion .smalldan {
    width: 36px;
    height: 60px;
    left: 21px;
    background-position: 0 -90px;
    border: 0px solid red;
    }
    .dandelion span {
    -webkit-animation: ball-x 3s linear 2s infinite;
      -moz-animation: ball-x 3s linear 2s infinite;
      animation: ball-x 3s linear 2s infinite;
    -webkit-transform-origin: bottom center;
      -moz-transform-origin: bottom center;
      transform-origin: bottom center;
    }
    .dandelion span {
    display: block;
    position: fixed;
    z-index:9999999999;
    bottom: 0px;
    background-image: url(https://mat1.gtimg.com/www/mb/images/zt/memory/pgy.png);
    background-repeat: no-repeat;
    _background: none;
    }
    .dandelion .bigdan {
    width: 64px;
    height: 115px;
    left: 47px;
    background-position: -86px -36px;
    border: 0px solid red;
    }
    @keyframes ball-x {0% { transform:rotate(0deg);}
       20% {transform:rotate(5deg); }
       40% {transform:rotate(0deg);}
       60% {transform:rotate(-5deg);}
       80% {transform:rotate(0deg);}
       100% {transform:rotate(0deg);}
    }
    @-webkit-keyframes ball-x {0% { -webkit-transform:rotate(0deg);}
       20% {-webkit-transform:rotate(5deg); }
       40% {-webkit-transform:rotate(0deg);}
       60% {-webkit-transform:rotate(-5deg);}
       80% {-webkit-transform:rotate(0deg);}
       100% {-webkit-transform:rotate(0deg);}
    }
    @-moz-keyframes ball-x {0% { -moz-transform:rotate(0deg);}
 
       20% {-moz-transform:rotate(5deg); }
       40% {-moz-transform:rotate(0deg);}
       60% {-moz-transform:rotate(-5deg);}
       80% {-moz-transform:rotate(0deg);}
       100% {-moz-transform:rotate(0deg);}
    }
    </style>

PS:在電腦上可以點擊運行進入預覽,群聊時博主見過很多新手站長說一看到代碼就頭疼,就會覺得很復雜,其實現在的互聯網如此開放,很多工作不再是敲代碼了,借力互聯網,給網頁加代碼也是一件比較簡單的事了。

正文完
 
丸趣
版權聲明:本站原創文章,由 丸趣 2023-06-03發表,共計1691字。
轉載說明:除特殊說明外本站除技術相關以外文章皆由網絡搜集發布,轉載請注明出處。
評論(沒有評論)
主站蜘蛛池模板: 武宁县| 定襄县| 民权县| 武功县| 安图县| 靖江市| 宁晋县| 金门县| 绥宁县| 高淳县| 布拖县| 潢川县| 申扎县| 罗源县| 西吉县| 孟州市| 仲巴县| 云林县| 厦门市| 郴州市| 耒阳市| 中西区| 黑河市| 云浮市| 汉寿县| 迁西县| 丰原市| 房产| 电白县| 阆中市| 茌平县| 孟津县| 若尔盖县| 岳池县| 蓬莱市| 阿城市| 辰溪县| 新乐市| 凤冈县| 绩溪县| 深圳市|