css3动画如何兼容ie9

左转右转
  • 1
新手上路,请多包涵
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        /*loading*/
        .load-bg{
            background: #2b2b2b;
            opacity: .5;
            position: absolute;
            width: 100%;
            height: 100%;
            /*display: none;*/
            top: 0px;
            z-index: 1;
        }
        .load-bg span{
            color: #fff;
            font-size: 20px;
            display: block;
            margin-top: 15px;
        }
        .load-bg span.load-EN {
            font-size: 14px;
        }
        .load-bg .load-outer {
            position: absolute;
            top: 44%;
            left: 50%;
            margin-left: -25px;
        }
        .load-bg .load-outer h4 {
            margin-left: -35px;
            margin-top: 30px;
            text-align: center;
        }
        .spinner {
            width: 60px;
            height: 60px;
            text-align: center;
            font-size: 10px;
        }

        .spinner > div {
            background-color: #67CF22;
            height: 100%;
            width: 6px;
            display: inline-block;
            margin-right: 3px;
            vertical-align: middle;
            -webkit-animation: stretchdelay 1.2s infinite ease-in-out;
            animation: stretchdelay 1.2s infinite ease-in-out;
        }

        .spinner .rect2 {
            -webkit-animation-delay: -1.1s;
            animation-delay: -1.1s;
        }

        .spinner .rect3 {
            -webkit-animation-delay: -1.0s;
            animation-delay: -1.0s;
        }

        .spinner .rect4 {
            -webkit-animation-delay: -0.9s;
            animation-delay: -0.9s;
        }

        .spinner .rect5 {
            -webkit-animation-delay: -0.8s;
            animation-delay: -0.8s;
        }

        @-webkit-keyframes stretchdelay {
            0%, 40%, 100% { -webkit-transform: scaleY(0.4) }
            20% { -webkit-transform: scaleY(1.0) }
        }

        @keyframes stretchdelay {
            0%, 40%, 100% {
                transform: scaleY(0.4);
                -webkit-transform: scaleY(0.4);
            }  20% {
                   transform: scaleY(1.0);
                   -webkit-transform: scaleY(1.0);
               }
        }

    </style>
</head>
<body>
<div class="load-bg">
    <div class="load-outer">
        <div class="spinner">
            <div class="rect1"></div>
            <div class="rect2"></div>
            <div class="rect3"></div>
            <div class="rect4"></div>
            <div class="rect5"></div>
        </div>
        <h4>
            <span class="load-CN">数据正在加载 ...</span>
            <span class="load-EN">Loading ...</span>
        </h4>
    </div>
</div>

</body>
</html>
回复
阅读 3.2k
1 个回答

IE9 不支持animation 其他的部分css3还可以 你用-ms-transform:scale兼容一下吧

宣传栏