This question has been already addressed, but none of the solutions have worked for me.
I referred to this earlier question addressing the same problem:
I noticed that one of the responses gave this jsfiddle link, which implements the exact functionality that I want, and works.
$("#topbar").toggle(function(){
$(this).animate({height:40},200);
},function(){
$(this).animate({height:10},200);
});
But when I changed the framework to anything but jQuery 1.4.4, the div starts instantly disappearing as soon as the page loads. This is the problem I've been having on my own project.
Any ideas on how to get that jsfiddle working on jquery 2.x? What am I missing?