我想移動基於頁面滾動的div,我已經閱讀this的問題,但它是基於純JavaScript的。jQuery移動頁面滾動的div
下面的代碼:
HTML:
<div class="outer-container">
<div class="inner-container">
<div class="slider-one slide" style="background-image:url('http://208.131.135.54/~imacre17/wp-content/uploads/2015/03/homeslide1a.png'); height: 100%; background-size: cover;" class="slider-background-image' ">
<div class="slide-inner-container">
<div class="slider-content">
<h4>The Course</h4>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
</p>
</div>
<!-- /.slider-content -->
<div class="clearfix"></div>
</div>
<!-- /.slide-inner-container -->
</div>
<!-- /.slide -->
<div class="slider-one slide" style="background-image:url('http://208.131.135.54/~imacre17/wp-content/uploads/2015/02/2-Home-membership.jpg'); height: 100%; background-size: cover;" class="slider-background-image' ">
<div class="slide-inner-container">
<!-- More content here soon -->
</div>
<!-- /.slide-inner-container -->
</div>
<!-- /.slide -->
<div class="slider-one slide" style="background-image:url('http://208.131.135.54/~imacre17/wp-content/uploads/2015/02/2-Home-special-events.jpg'); height: 100%; background-size: cover;" class="slider-background-image' ">
<div class="slide-inner-container">
<!-- More content here soon -->
</div>
<!-- /.slide-inner-container -->
</div>
<!-- /.slide -->
<div class="slider-one slide" style="background-image:url('http://208.131.135.54/~imacre17/wp-content/uploads/2015/03/CORKHome-_position4.jpg'); height: 100%; background-size: cover;" class="slider-background-image' ">
<div class="slide-inner-container">
<!-- More content here soon -->
</div>
<!-- /.slide-inner-container -->
</div>
<!-- /.slide -->
</div>
<!-- /.inner-container -->
</div>
<!-- /.outer-container -->
我想'.slider-content'
類股利對頁面滾動移動就像reference link
任何幫助,將不勝感激。
您是否試圖自己編寫腳本? – Todd
我做過了,我會用我的嘗試更新這個問題,但我不熟悉pageYOffset – chandan
你有分號';'在你的每個css屬性之後jquery。事實上,你不需要他們。 http://jsfiddle.net/yak613/657mm7Lz/ – TricksfortheWeb