1

how to make div block, witch will start scrolling on one point in site with scrollbar (position: fixed) and ends scrolling in other point.

http://postimage.org/image/oka20h80z/

Block starts scrolling on first black line and end scrolling on second black line and stays

<div class="header"></div>
<div class="wrapper">
    <div class="content"></div>
    <div class="slider"></div>
</div>
<div class="footer"></div>
4

1 回答 1

0

你需要使用滚动条。就像是

if( scrollTop() > 500 ){
  selector.css('position', 'fixed');
}
if( scrollTop() > 1000 ){
  selector.css('position', 'relative');
}

像这样的东西。如果它已滚动超过 500 像素,请将其固定。如果它已滚动超过 1000 条,请执行此操作。

于 2012-12-30T13:24:33.683 回答