希望有人可以帮助我:
我正在开发一个单页布局网站,其中包含一些关键帧动画和几个固定的背景图像,这些图像在您向下滚动时会覆盖。
奇怪(或不奇怪),我无法管理背景附件:固定与关键帧动画一起使用:
<style>
.container{with:300px; height:400px}
.scaleAnimation {
width:300px;
height:300px;
background-color:blue;
-webkit-animation: scale 6s ease 3 normal;
background-image:url("http://tympanus.net/Development/FullscreenLayoutPageTransitions/images/3.jpg");
margin-bottom:20px;
}
.mask {
background-attachment:fixed;
position:relative;
width:400px;
height:300px
}
.mask1 {
background-image:url(http://tympanus.net/Development/FullscreenLayoutPageTransitions/images/1.jpg);
background-position: 0px 0px;
background-repeat: no-repeat;
}
.mask2 {
background-image:url(http://tympanus.net/Development/FullscreenLayoutPageTransitions/images/2.jpg);
background-position: 0px 0px;
background-repeat: no-repeat;
}
@-webkit-keyframes scale {
from {
-webkit-transform: scale(1.1);
}
to {
-webkit-transform: scale(1);
}
}
</style>
<div id="wrapper">
<div class="container">
<div class="scaleAnimation"></div>
</div>
<div class="container">
<div class="mask mask1"></div>
<div class="mask mask2"></div>
</div>
</div>
示例:http: //jsfiddle.net/fpuLR/2/
如果我删除动画,背景附件工作正常:
.scaleAnimation {
width:300px;
height:300px;
background-color:blue;
-webkit-animation: scale 6s ease 3 normal;
background-image:url("http://tympanus.net/Development/FullscreenLayoutPageTransitions/images/3.jpg");
margin-bottom:20px;
}
示例:http: //jsfiddle.net/fpuLR/3/
知道为什么会这样吗?
提前致谢, Ku4ttro