• 实现雨滴的效果


    index.js

    *,

    *:after,

    *:before {

    -webkit-box-sizing: border-box;

    -moz-box-sizing: border-box;

    box-sizing: border-box;

    }

     

    .clearfix:after {

    visibility: hidden;

    display: block;

    font-size: 0;

    content: " ";

    clear: both;

    height: 0;

    }

     

    .clearfix {

    *zoom: 1;

    }

     

    .fl {

    float: left;

    }

     

    .fr {

    float: right;

    }

     

    .fl,

    .fr {

    _display: inline;

    }

     

    .top-banner {

    position: absolute;

    z-index: 999;

    left: 0;

    top: 0;

    height: 40px;

    line-height: 40px;

    padding: 0 30px;

    width: 100%;

    font-size: 13px;

    background-color: rgba(255, 255, 255, 0.15);

    color: #fff;

    }

     

    .top-banner a {

    color: #fff;

    text-decoration: none;

    }

    index.html

    <!DOCTYPE html>

    <html lang="zh-cn">

        <head>

            <meta charset="utf-8">

            <title>Rainy Day – 逼真的雨滴效果</title>

            <style media="screen">

                body {

                    overflow: hidden;

                    height: 100%;

                    margin: 0;

                    padding: 0;

                }

     

                img {

                    width: 100%;

                    height: 100%;

                }

            </style>

            <link rel="stylesheet" href="css/index.css">

            <script src="js/rainyday.js"></script>

            <script>

                function run() {

                    var image = document.getElementById('background');

                    image.onload = function() {

                        var engine = new RainyDay({

                            image: this

                        });

    engine.rain([ [3, 2, 2] ], 100);

    };

                    image.crossOrigin = 'anonymous';

                    image.src = 'http://i.imgur.com/U1Tqqdw.jpg';

                }

            </script>

        </head>

        <body onload="run();">

            <img id="background" alt="background" src="" />

        </body>

        <div style="position:fixed;bottom:30px;width:100%;height:90px;z-index:999">

            <div class="footer-banner" style="width:728px; margin:0 auto"></div>

        </div>

    </html>

  • 相关阅读:
    异常类
    设计模式
    java的参数传递
    meta 标签中 http-equiv 的作用
    导入CSV格式文件方法
    第四次博客作业-结对项目
    第九次作业-接口及接口回调
    第八次作业-继承
    软件工程第三次作业——关于软件质量保障初探
    Java第七次作业
  • 原文地址:https://www.cnblogs.com/luckyXcc/p/5743612.html
Copyright © 2020-2023  润新知