zoukankan      html  css  js  c++  java
  • CSS3 动画

    加载动画

    @-webkit-keyframes elasticInDown {
        0% {
            opacity: 0;
            -webkit-transform: translateY(-1000px);
            -webkit-animation-timing-function: ease-in-out
        }
    
        60% {
            opacity: 1;
            -webkit-transform: translateY(30px);
            -webkit-animation-timing-function: ease-in-out
        }
    
        80% {
            -webkit-transform: translateY(-10px);
            -webkit-animation-timing-function: ease-in-out
        }
    
        100% {
            -webkit-transform: translateY(0)
        }
    }
    
    @-moz-keyframes elasticInDown {
        0% {
            opacity: 0;
            -moz-transform: translateY(-1000px);
            -moz-animation-timing-function: ease-in-out
        }
    
        60% {
            opacity: 1;
            -moz-transform: translateY(30px);
            -moz-animation-timing-function: ease-in-out
        }
    
        80% {
            -moz-transform: translateY(-10px);
            -moz-animation-timing-function: ease-in-out
        }
    
        100% {
            -moz-transform: translateY(0)
        }
    }
    
    @-o-keyframes elasticInDown {
        0% {
            opacity: 0;
            -o-transform: translateY(-1000px);
            -o-animation-timing-function: ease-in-out
        }
    
        60% {
            opacity: 1;
            -o-transform: translateY(30px);
            -o-animation-timing-function: ease-in-out
        }
    
        80% {
            -o-transform: translateY(-10px);
            -o-animation-timing-function: ease-in-out
        }
    
        100% {
            -o-transform: translateY(0)
        }
    }
    
    @keyframes elasticInDown {
        0% {
            opacity: 0;
            transform: translateY(-1000px);
            animation-timing-function: ease-in-out
        }
    
        60% {
            opacity: 1;
            transform: translateY(30px);
            animation-timing-function: ease-in-out
        }
    
        80% {
            transform: translateY(-10px);
            animation-timing-function: ease-in-out
        }
    
        100% {
            transform: translateY(0)
        }
    }
    
    .elasticInDown {
        -webkit-animation-name: elasticInDown;
        -moz-animation-name: elasticInDown;
        -o-animation-name: elasticInDown;
        animation-name: elasticInDown
    }
    .a {
        -webkit-animation-fill-mode: both;
        -moz-animation-fill-mode: both;
        -ms-animation-fill-mode: both;
        -o-animation-fill-mode: both;
        animation-fill-mode: both;
        -webkit-animation-duration: .6s;
        -moz-animation-duration: .6s;
        -ms-animation-duration: .6s;
        -o-animation-duration: .6s;
        animation-duration: .6s
    }

    鼠标划过效果一,缺点是效果比较简单

    .imgBoxMask2
    {
        width: 100%;
        top: 0%;
        z-index: 99;
        position: absolute;
        text-align: center;
        transition: all 0.5s ease-in-out;
        -moz-transition: all 0.5s ease-in-out;
        -webkit-transition: all 0.5s ease-in-out;
        -o-transition: all 0.5s ease-in-out;
        opacity: 0;
    }
    .imgBox:hover .imgBoxMask2
    {
        top: 40%;
        opacity: 1;
    }

    还可以通过jquery设置css实现

    $('.imgBox').hover(
                function () {
                    $('.imgBoxMask1').fadeIn();
    
                    $('.imgBoxMask1').addClass("a");
                    $('.imgBoxMask1').addClass("elasticInDown");
                },
                function () {
                    $('.imgBoxMask1').hide();
                    $('.imgBoxMask1').removeClass("a");
                    $('.imgBoxMask1').removeClass("elasticInDown");
                }
            );

    还可以通过
    animation:mymove 5s设置keysframe实现动画

  • 相关阅读:
    js获取服务器值以及服务器获取客户端值
    兼容IE Firefox的table自动换行
    sql行转列,列转行
    JS 压缩解压工具
    ASP.NET组织结构图的画法——数据来源读取数据库
    ANGULAR7的应用和跨域问题解决
    Ajax的使用之ScriptManager
    【.NET序列化和反序列化】基本篇
    Web Service的安全访问【SoapHeader身份认证】
    【C#3.0本质论 第一章】C#和.NET Framework概览
  • 原文地址:https://www.cnblogs.com/liushunli/p/9723145.html
Copyright © 2011-2022 走看看