【发布时间】:2013-03-17 23:50:30
【问题描述】:
嘿,伙计们,我目前正在使用 css3 关键帧构建一个图像显示(小),它正在运行,但仅在 Firefox 上以某种方式运行,我似乎无法解决这个问题 :( 它应该在最新版本的chrome firefox 和 safari,但目前只能在 firefox 中使用。
谁能帮忙?
这是应该在以上所有浏览器中工作的 css。
@keyframes cf4FadeInOut {
0% {
opacity:1;
}
17% {
opacity:1;
}
25% {
opacity:0;
}
92% {
opacity:0;
}
100% {
opacity:1;
}
}
.case-image {
position:relative;
height:auto;
width:32%;
}
.case-image img {
position:absolute;
width: 100%;
height: auto;
left:0;
border: 3px solid #f8d206;
-moz-border-radius: 15px;
border-radius: 15px;
margin-left: -3px;
margin-right: -3px;
}
.case-image img {
-webkit-animation-name: cf4FadeInOut;
-webkit-animation-timing-function: ease-in-out;
-webkit-animation-iteration-count: infinite;
-webkit-animation-duration: 8s;
-moz-animation-name: cf4FadeInOut;
-moz-animation-timing-function: ease-in-out;
-moz-animation-iteration-count: infinite;
-moz-animation-duration: 8s;
-o-animation-name: cf4FadeInOut;
-o-animation-timing-function: ease-in-out;
-o-animation-iteration-count: infinite;
-o-animation-duration: 8s;
animation-name: cf4FadeInOut;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
animation-duration: 8s;
}
.case-image img:nth-of-type(1) {
-webkit-animation-delay: 6s;
-moz-animation-delay: 6s;
-o-animation-delay: 6s;
animation-delay: 6s;
}
.case-image img:nth-of-type(2) {
-webkit-animation-delay: 4s;
-moz-animation-delay: 4s;
-o-animation-delay: 4s;
animation-delay: 4s;
}
.case-image img:nth-of-type(3) {
-webkit-animation-delay: 2s;
-moz-animation-delay: 2s;
-o-animation-delay: 2s;
animation-delay: 2s;
}
.case-image img:nth-of-type(4) {
-webkit-animation-delay: 0;
-moz-animation-delay: 0;
-o-animation-delay: 0;
animation-delay: 0;
}
【问题讨论】:
-
你写出你的过渡属性有什么原因吗?
-
您是否也在某处使用@-webkit-keyframes 前缀?
-
不,我已经用教程构建了这个,没有太多的编码英雄,如果我理解正确的话 -o- -mox- -webkit- 用于不同的浏览器?
-
在 css 验证器中还声明了以下内容:规则 405 .case-image img:nth-of-type(4) 0 is not a animation-delay value : 0
-
是的 :) 所以你为动画指定和重复代码的方式相同,例如-moz-animation-name... -webkit-animation-name... 您需要为@keyframes 执行此操作。所以它确实增加了很多重复的代码,但是在当前支持它的浏览器中运行是必要的。
标签: css transition css-animations