2

我正在尝试使用关键帧制作一个简单的动画,但它只适用于 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;

 }

关于如何修复它或其他浏览器尚不支持关键帧的任何想法?

4

1 回答 1

2

background-image 本身似乎不是有效的可转换属性。它可能碰巧在 Chrome 中工作,但它可能只是幸运的。实现后,您将希望在 CSS 图像中使用交叉淡入淡出功能。

于 2012-09-27T15:47:49.250 回答