Please help me with CSS to obtain one special visual effect. I have a container div which contains 3 divs inside.
First DIV is hidden;
Second DIV is a button which Slide Up and Down the First DIV;
Third DIV is a div with Overflow properties which scroll the information inside.
I do not know how to change/adjust the height of DIV-3 when DIV-1 is scrolling down - to keep DIV-3 inside of Div CONTAINER. I hope someone else faced such problem before and can recommend something useful.
Please have a look in my JSFIDDLE in order to see the real example. Thank you for your time!
EXAMPLE
<div class="container">
<div class="updiv">Header info</div>
<div class="middle" onclick="uparrow()">button UP and DOWN</div>
<div class="bottomdiv">
<div class="block">111</div>
<div class="block">222</div>
<div class="block">333</div>
<div class="block">444</div>
</div>
</div>
CSS
.container{
width:400px;
height:400px;
border:1px solid red;
position: relative;
}
.updiv{
display:none;
width:392px;
height:100px;
margin:3px;
border:1px solid blue;
background:yellow;
}
.middle{
margin:3px;
width:392px;
height:30px;
background:green;
color:white;
text-align:center;
}
.block{
width:100%;
height:100px;
background:pink;
margin-bottom:20px;
}
.bottomdiv{
overflow-y: scroll;
margin:3px;
width:392px;
height:350px;
display:block;
border:1px solid blue;
}
SCRIPT
function uparrow(){
$('.updiv').slideToggle();
}