CSS 关键帧仅适用于 Chrome

标签 css css-animations

我正在尝试使用关键帧制作一个简单的动画,但它仅适用于 Chrome。这是代码(为了更短的帖子,我只包含一次关键帧代码):

@keyframes logokf {
    0% {
    background-image: url('gfx/logo1.png');
    }    
    20% {
    background-image: url('gfx/logo2.png');
    }    
    40% {
    background-image: url('gfx/logo3.png');
    }    
    60% {
    background-image: url('gfx/logo4.png');
    }    
    80% {
    background-image: url('gfx/logo1.png');
    }    
    100% {
    background-image: url('gfx/logo1.png');
    }

}


@-webkit-keyframes logokf {    
}

@-moz-keyframes logokf {             
}

@-o-keyframes logokf { 
}

@-ms-keyframes logokf {
}

#logo:hover {
float: left;
height: 75px;
margin: 28px 0 22px;
width: 276px;

/*animation-name*/
-webkit-animation-name:logokf;
-moz-animation-name:logokf;
-ms-animation-name:logokf;
-o-animation-name:logokf;
animation-name:logokf;

/*animation-duration*/
-webkit-animation-duration:1s;
-moz-animation-duration:1s;
-ms-animation-duration:1s;
-o-animation-duration:1s;
animation-duration:1s;

/*animation-iteration-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;

/*animation-timing-function*/
-webkit-animation-timing-function:lineare;
-moz-animation-timing-function:lineare;
-ms-animation-timing-function:lineare;
-o-animation-timing-function:lineare;
animation-timing-function:lineare;

/*animation-delay*/
-webkit-animation-delay:0s;
-moz-animation-delay:0s;
-ms-animation-delay:0s;
-o-animation-delay:0s;
animation-delay:0s;

 }

有什么想法可以解决这个问题,或者其他浏览器尚不支持关键帧?

最佳答案

背景图像本身似乎不是 a valid transitionable property.它可能碰巧在 Chrome 中工作,但这可能只是运气好。实现后,您将希望使用 crossfade capability在 CSS 图像中。

关于CSS 关键帧仅适用于 Chrome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12622598/

相关文章:

php - Wordpress:在页 footer 分创建列

javascript - AngularJS 动画回调,等待下一个动画开始

css - @keyframes 动画没有运行

css - 从正方形到充满渐变的右梯形的动画变换

html - 斜边的形状(响应式)

asp.net - GridView 元素未正确对齐

jquery - 选择自定义属性设置样式

CSS3 过渡最大高度 : 0 to max-height : 99999px

css - 需要使用动画旋转元素并将其保持在旋转位置

javascript - 更改滚动时的 Div 显示元素