CSS3动画在除Chrome以外的所有浏览器中工作

CSS3 animations working in every browser except Chrome

本文关键字:浏览器 工作 动画 Chrome CSS3      更新时间:2023-09-26

在所有浏览器中都可以完美地工作,除了Chrome。淡出效果似乎工作得很好,但floatInCommand动画口吃,使表扬(一个引导容器)锁定在1秒后到位。我不知道我是否需要添加任何东西除了"-webkit"。我看过有类似问题的线程,他们都通过添加"-webkit"来修复它。

.slide-in {
    -webkit-animation-name: floatInCommend;
    -webkit-animation-duration: 2s;
    -webkit-animation-fill-mode: both; /* Safari 4.0 - 8.0 */
    -moz-animation-fill-mode: both;
    animation-fill-mode: both;
    -webkit-animation-direction: normal;
    -webkit-animation-delay: 1.25s;
}
@-webkit-keyframes floatInCommend {
    from {
        opacity: 0;
        top: -100%;
    }
    to {
        opacity: 1;
        top: 75;
    }
}
.slide-in-footer {
    -webkit-animation-name: floatInFooter;
    -webkit-animation-duration: 2s;
    animation-fill-mode: both;
    -webkit-animation-fill-mode: both; /* Safari 4.0 - 8.0 */
    -moz-animation-fill-mode: both;
    -webkit-animation-direction: normal;
    -webkit-animation-delay: 0.5s;
}
@-webkit-keyframes floatInFooter {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
.slide-in-nav {
    -webkit-animation-name: floatInFooter;
    -webkit-animation-duration: 2s;
    animation-fill-mode: both;
    -webkit-animation-fill-mode: both; /* Safari 4.0 - 8.0 */
    -moz-animation-fill-mode: both;
    -webkit-animation-direction: normal;
    -webkit-animation-delay: 0.5s;
}
@-webkit-keyframes floatInNav {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

您需要-webkit, -moz和非供应商前缀属性。考虑使用任务运行器和自动修复器,以确保在发布代码之前,所有的css供应商前缀都已到位。

相关文章: