一个可以手写原型链的男人

Animate.css flash动画兼容ie8 ie9方法

《Animate.css flash动画兼容ie8 ie9方法》

动画代码

.animated{
    animation-duration: 1s;
    animation-fill-mode: both
}
.flash {
    -webkit-animation-name: flash;
    animation-name: flash
}
@-webkit-keyframes flash {
    0%,50%,to {
        opacity: 1
    }

    25%,75% {
        opacity: 0
    }
}

@keyframes flash {
    0%,50%,to {
        opacity: 1
    }

    25%,75% {
        opacity: 0
    }
}

兼容ie8、ie9的js代码

function isCss3(){
    var style=document.createElement("div").style;
        for(var k in style){
            if(k.toLowerCase().indexOf("animation")!=-1){
                return true;
            }
       }
       return false;
};
function blink(dom){
    if(!isCss3())
        dom.css("opacity",1).animate({opacity:0},10).delay(150).animate({opacity:1},10).delay(150).animate({opacity:0},10).delay(150).animate({opacity:1},10);
}

调用方法
blink($(“.”+prizeid).find(“.fit_one”));

animate.css link:https://daneden.github.io/animate.css/

animate.css gitHub link:https://github.com/daneden/animate.css

点赞

发表评论