У меня есть скрытое меню, которое сдвигается вниз при нажатии на ленту, но сама лента остается на своем месте. Мне бы хотелось, чтобы лента скользила вниз вместе с остальной частью меню, а также при закрытии меню, чтобы лента снова поднималась.
HTML-код
<div id="topbar">
<div id="tophiddenbar" style="display: none;">
<p>stuff goes here</p>
</div>
<div id="menu" class="ribbon">
<p>Menu</p>
</div>
</div>
код CSS
#topbar {
background: #0174C3;
color: #fff;
padding: 0 0 15px 0;
font-size: 62.5%;
text-align: center;
height: 10px;
overflow: hidden;
-webkit-transition: height 0.5s linear;
-moz-transition: height 0.5s linear;
transition: height 0.5s linear;
}
#topbar.active {
height: 250px;
}
.ribbon {
position: absolute;
top: 15px;
left: 50%;
width: 50px;
height: 20px;
background-color: #444;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
}
Код запроса
$("#menu").click(function(){
$("#topbar").toggleClass('active');
$("#tophiddenbar").toggle();
});
Образец кодепа
https://codepen.io/anon/pen/wZEKBz
Текущее поведение по умолчанию при загрузке страницы
![enter image description here](https://i.stack.imgur.com/w8m3D.png)
Текущее поведение при нажатии на ленту
![enter image description here](https://i.stack.imgur.com/nPqff.png)
Ожидаемое поведение при нажатии на ленту
![enter image description here](https://i.stack.imgur.com/ruzo0.png)