我在Chrome和Safari中测试了这个css循环 - 效果很好。但动画在Firefox和IE中无效。
问题出在哪里?我已经定义了-moz-前缀。 或者我应该停止为伪元素使用css过渡?
/* fullscreen div */
section_2.cd-single-project.is-loaded.is-full-width:after {
top: 0;
left: 0;
height: 100%;
width: 100%;
/* name */
-webkit-animation-name: fading;
-moz-animation-name: fading;
-ms-animation-name: fading;
-o-animation-name: fading;
animation-name: fading;
/* count */
-webkit-animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
-ms-animation-iteration-count: infinite;
-o-animation-iteration-count: infinite;
animation-iteration-count: infinite;
/* duration */
-webkit-animation-duration: 12s;
-moz-animation-duration: 12s;
-ms-animation-duration: 12s;
-o-animation-duration: 12s;
animation-duration: 12s;
}
/* fade safari */
@-webkit-keyframes fading {
0% { background-image:url("1.jpg"); background-repeat: no-repeat;background-position: center center;background-size: cover; }
25% { background-image:url("2.jpg"); background-repeat: no-repeat;background-position: center center;background-size: cover; }
50% { background-image:url("3.jpg"); background-repeat: no-repeat;background-position: center center;background-size: cover; }
}
/* fade firefox */
@-moz-keyframes fading {
0% { background-image:url("1.jpg"); background-repeat: no-repeat;background-position: center center;background-size: cover; }
25% { background-image:url("2.jpg"); background-repeat: no-repeat;background-position: center center;background-size: cover; }
50% { background-image:url("3.jpg"); background-repeat: no-repeat;background-position: center center;background-size: cover; }
}
/* fade opera */
@-o-keyframes fading {
0% { background-image:url("1.jpg"); background-repeat: no-repeat;background-position: center center;background-size: cover; }
25% { background-image:url("2.jpg"); background-repeat: no-repeat;background-position: center center;background-size: cover; }
50% { background-image:url("3.jpg"); background-repeat: no-repeat;background-position: center center;background-size: cover; }
}
/* fade general */
@keyframes fading {
0% { background-image:url("1.jpg"); background-repeat: no-repeat;background-position: center center;background-size: cover; }
25% { background-image:url("2.jpg"); background-repeat: no-repeat;background-position: center center;background-size: cover; }
50% { background-image:url("3.jpg"); background-repeat: no-repeat;background-position: center center;background-size: cover; }
}
答案 0 :(得分:0)
你可以尝试添加"动画填充模式:两者都是"看到的东西。 我认为,可能是动画已经结束或未被触发。
答案 1 :(得分:0)
section_2
在<section_2></section_2>
内,否则 html
不是有效的选择器?
section_2
是否为class
元素,缺少.
.section_2
?,或id
缺少#
{{}元素1}}?