jquery: animate function problem
- by Syom
i start learning jquery just yesterday. i have a div element with some content, and i want to hide it by changing it's height:
here is the script
<script type="text/javascript">
$(document).ready(function(){
$("#hide").click(function(){
$("#cont").animate({
height: '0'
},1500);
$("#cont").hide();
});
});
</script>
<input type="button" value="hide" id="hide">
<div id="cont">
text here...
</div>
but it doesn't work, becouse it automaticaly sets display:block to #cont element, so after animation it starts to show.
when i try to set display:none to #cont element, it doesn't happen.
could you help me? thanks