zoukankan      html  css  js  c++  java
  • 花里胡哨的CSS集锦

    1.水波纹特效

    HTML

    <div is="page" id="home" data-role="page">
      <div is="content" role="main" class="ui-content">
        <div is="dragable" class="bg"></div>
      </div>
    </div>

    CSS

    html,body,#home,.ui-content{
      margin:0;
      padding:0;
      height:100%;
      100%;
      overflow:hidden;
      cursor:pointer;
    }
    .bg{
      100%;
      height:100%;
      background-image:url(https://pics.codecolor.cn/water-wave/bg.jpg);
      background-attachment:fixed;
      background-position:center center; 
      background-size:auto 100%;
    }
    .wave-position{
      position:absolute;
      300px;
      height:300px;
    }
    .wave-body{
      position:relative;
      100%;
      height:100%;
    }
    .wave{
      position:absolute;
      top:calc((100% - 30px)/2);
      left:calc((100% - 30px)/2);
      30px;
      height:30px;
      border-radius:300px;
      background:url(https://pics.codecolor.cn/water-wave/bg.jpg);
      background-attachment:fixed;
      background-position:center center;
    }
    .wave0{
      z-index:2;
      background-size:auto 106%;
      -webkit-animation:w 1s;
      -moz-animation:w 1s;
      animation:w 1s;
    }
    .wave1{
      z-index:3;
      background-size:auto 102%;
      -webkit-animation:w 1s .15s;
      -moz-animation:w 1s .15s;
      animation:w 1s .15s;
    }
    .wave2{
      z-index:4;
      background-size:auto 104%;
      -webkit-animation:w 1s .3s;
      -moz-animation:w 1s .3s;
      animation:w 1s .3s;
    }
    .wave3{
      z-index:5;
      background-size:auto 101%;
      -webkit-animation:w 1s .45s;
      -moz-animation:w 1s .45s;
      animation:w 1s .45s;
    }
    .wave4{
      z-index:6;
      background-size:auto 102%;
      -webkit-animation:w 1s .6s;
      -moz-animation:w 1s .6s;
      animation:w 1s .6s;
    }
    .wave5{
      z-index:7;
      background-size:auto 100%;
      -webkit-animation:w 1s .75s;
      -moz-animation:w 1s .75s;
      animation:w 1s .75s;
    }
    @-webkit-keyframes w{
      0%{
        top:calc((100% - 30px)/2);
        left:calc((100% - 30px)/2);
        30px;
        height:30px;
        opacity:1;
      }
      99%{
        opacity:1;
      }
      100%{
        top:calc((100% - 300px)/2);
        left:calc((100% - 300px)/2);
        300px;
        height:300px;
        opacity:0;
      }
    }
    @-moz-keyframes w{
      0%{
        top:calc((100% - 30px)/2);
        left:calc((100% - 30px)/2);
        30px;
        height:30px;
        opacity:1;
      }
      99%{
        opacity:1;
      }
      100%{
        top:calc((100% - 300px)/2);
        left:calc((100% - 300px)/2);
        300px;
        height:300px;
        opacity:0;
      }
    }
    @keyframes w{
      0%{
        top:calc((100% - 30px)/2);
        left:calc((100% - 30px)/2);
        30px;
        height:30px;
        opacity:1;
      }
      99%{
        opacity:1;
      }
      100%{
        top:calc((100% - 300px)/2);
        left:calc((100% - 300px)/2);
        300px;
        height:300px;
        opacity:0;
      }
    }
    

      

    js

    (function () {
      $(document).on('pageshow', '#home', function () {
        var mx, my, timer;
        var z = 2;
        $(document).on('click', function (e) {
          mx = e.pageX;
          my = e.pageY;
          z = z + 1;
          _wave(mx, my, z);
        });
    
        function _wave(i, j, k) {
          $('.ui-content').prepend(
            '<div class="wave-position water' + k + '" style="z-index:' + k + ';top:' + (j - 150) + 'px;left:' + (i - 150) + 'px;">' +
            '<div class="wave-body">' +
            '<div class="wave wave5"></div>' +
            '<div class="wave wave4"></div>' +
            '<div class="wave wave3"></div>' +
            '<div class="wave wave2"></div>' +
            '<div class="wave wave1"></div>' +
            '<div class="wave wave0"></div>' +
            '</div>' +
            '</div>'
          );
          setTimeout(function () {
            $('.water' + k).remove();
          }, 3000);
        }
      });
    })();
    

      

  • 相关阅读:
    收集于网络的Web Standard规范化CSS+XHTML命名参考
    【转】6 个强大的 HTML5 应用在线开发工具
    【转】2012年度最新免费web开发设计资源荟萃
    优秀网站精选
    【转】inlineblcok 前世今生
    130+ 网页设计工具
    【转】60款很酷的 jQuery 幻灯片演示和下载
    【转载】用CSS3做的动画按钮
    有用网站收集
    『转』Photoshop中改进ios设计流程的30个诀窍
  • 原文地址:https://www.cnblogs.com/qiyan/p/10897884.html
Copyright © 2011-2022 走看看