Я хотел придерживаться второго div, когда мы прокручиваем страницу вниз и когда второй div встречает верхнюю границу. Когда он будет исправлен, он должен прокручиваться вместе с другими страницами. Как я могу достичь этого?
#settings{
width:100%;
background:#383838;
height:60px;
}
#menu{
width:100%;
position:relative;
height:100px;
background:#aaa;
}
#body-content{
height:900px;
position:relative;
}
и HTML
<body>
<div id="top">
<div id="settings">
</div>
<div id="menu">
</div>
</div>
<div id="body-content">
</div>
</body>
Здесь, в этом примере http://jsfiddle.net/WBur3/, 2-й div должен быть исправлен при прокрутке страницы. Когда мы прокручиваем вверх, нужно переходить в предыдущее состояние. Пожалуйста, помогите мне.