小编Cha*_*son的帖子

使用CSS3动画更改背景图像

为什么这不起作用?我究竟做错了什么?

CSS

@-webkit-keyframes test {
  0% {
    background-image: url('frame-01.png');
  }
  20% {
    background-image: url('frame-02.png');
  }
  40% {
    background-image: url('frame-03.png');
  }
  60% {
    background-image: url('frame-04.png');
  }
  80% {
    background-image: url('frame-05.png');
  }
  100% {
    background-image: url('frame-06.png');
  }
}

div {
  float: left;
  width: 200px;
  height: 200px;
  -webkit-animation-name: test;
  -webkit-animation-duration: 10s;
  -webkit-animation-iteration-count: 2;
  -webkit-animation-direction: alternate;
  -webkit-animation-timing-function: linear;
}
Run Code Online (Sandbox Code Playgroud)

DEMO

http://jsfiddle.net/hAGKv/

提前致谢!

css background-image css3 css-animations

31
推荐指数
3
解决办法
11万
查看次数

标签 统计

background-image ×1

css ×1

css-animations ×1

css3 ×1