jquery - resize height of div with overflow -
please me css obtain 1 special visual effect. have container div contains 3 divs inside.
first div hidden;
second div button slide , down first div;
third div div overflow properties scroll information inside.
i not know how change/adjust height of div-3 when div-1 scrolling down - keep div-3 inside of div container. hope else faced such problem before , can recommend useful.
please have in jsfiddle in order see real example. thank time!
example
<div class="container"> <div class="updiv">header info</div> <div class="middle" onclick="uparrow()">button , 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(); }
you gave parent container fixed height of 400px, means problem you're forcing have height no matter what, just remove it.
Comments
Post a Comment