固定背景滚动效果

mrk*_*rks 1 css scroll background css3

简短的问题:如何用css实现这种滚动效果? - >

http://focuslabllc.com/

我已经尝试过了:

#one {
    background: url(http://images.buzzillions.com/images_products/07/02/iron-horse-    maverick-elite-mountain-bike-performance-exclusive_13526_100.jpg);
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment:fixed;
}

#two {
    background: url(http://img01.static-nextag.com/image/GMC-Denali-Road-Bike/1/000/006/107/006/610700673.jpg);
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment:fixed;
}
Run Code Online (Sandbox Code Playgroud)

谢谢!:)

b.k*_*ley 5

它被称为"窗帘揭示",但在这种情况下它反过来. http://www.thecssninja.com/css/reveal-effect

基本上,第一个"幻灯片"位于所有其他内容的"下方",并设置为position: fixed和说z-index: 1,所有其他内容都设置为position: relativez-index: 10

http://jsfiddle.net/3n1gm4/8gDDy/

所以在代码中它会是

HTML

<div class="slide1">CONTENT</div>
<div class="slide2">CONTENT</div>
Run Code Online (Sandbox Code Playgroud)

CSS

.slide1 { 
    position: fixed;
    z-index: 1;  /* sets it below the other slides in the layer stack */
    height: 100%
}
.slide2 {
    position: relative;
    z-index: 10;  /* sets it above .slide1  */
    margin-top: 100%; /* this pushes it below .slide1 in the scroll */
    height: 100% /* full length slides */
}
Run Code Online (Sandbox Code Playgroud)

*这很快就完成了,可能不是100%准确,但旨在让你了解最新情况.