I want to have a div which is shown just top part of it (like 50px oh height) and other (bottom like 100px) part of the div should be shown by jquery.show() or something else. Is there anyone know how to do it ?
You could set the div height to 50px fixed and on click you can change the height to auto per javascript/jQuery, or revert it from auto to 50px.
CSS:
.mydiv{
height:50px;
min-height:50px;
overflow:hidden;
}
jQuery:
$("document").ready(function(){
$(".mydiv").click(function(){
if($(".mydiv").css("height")!="50px"){
$(".mydiv").slideDown();
}
else{
$(".mydiv").slideUp();
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With