动画css不起作用

时间:2015-07-03 06:34:24

标签: jquery css animation

我必须动态地移动图像。但它不起作用。 这是我的css和html代码。



.demo-section{
  background: url('http://xxxxx/images/homepages/faces.png') repeat scroll 0 0 transparent;
  -webkit-animation: sliding 60s linear infinite;
  -moz-animation: sliding 60s linear infinite;
  -ms-animation: sliding 60s linear infinite;
  -o-animation: sliding 60s linear infinite;
  animation: sliding 60s linear infinite;
  padding: 55px 0 45px;
}

<div class="demo-section">
  <h1>Demo Content</h1> 
</div>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:1)

希望这能解决你的问题,试试这个:

.demo-section{
  background: url('http://xxxxx/images/homepages/faces.png') no-repeat scroll 0 0 transparent;
    -webkit-transition: left 3s; /* For Safari 3.1 to 6.0 */
    transition: left 3s;
    left:10px;
    position:relative;
    padding: 55px 0 45px;
}

div:hover {
    left: 100px;
}

感谢。