我想要以缓慢的速度动画化一个div元素的背景位置,但是不希望它有突然的抖动。你可以在这里看到我目前的尝试结果:
@-webkit-keyframes MOVE-BG {
from {
background-position: 0% 0%
}
to {
background-position: 187% 0%
}
}
#content {
width: 100%;
height: 300px;
background: url(http://www.gstatic.com/webp/gallery/1.jpg) 0% 0% repeat;
text-align: center;
font-size: 26px;
color: #000;
-webkit-animation-name: MOVE-BG;
-webkit-animation-duration: 100s;
-webkit-animation-timing-function: linear;
-webkit-animation-iteration-count: infinite;
}
我已经做了几个小时,但找不到任何能以亚像素级别缓慢平滑地动画化的东西。 我当前的示例是基于此页面上的示例代码制作的:http://css-tricks.com/parallax-background-css3/
我想要的动画平滑度可以在这个页面的translate()示例中看到:
http://css-tricks.com/tale-of-animation-performance/
如果不能使用background-position实现,请问是否有一种方法使用多个div来模拟重复背景,并使用translate移动这些div?