I don't know much about jQuery's
toggle method, so I looked in the docs, and sure enough it gives some helpful info. (This is a gentle hint that before coming to StackOverflow you should try solving the problem on your own, including looking at any relevant documentation online).
The .toggle() method animates the width, height, and opacity of the matched elements simultaneously.
The documentation doesn't give any info about customizing how
toggle does its animation, so it looks like you're stuck. If I'm understanding you correctly, it seems like you want the element to animate only the height and not the width, so it stays the same width as it toggles and just animates the height. I don't see any way of doing that with jQuery's
BUT WAIT! It looks like jQuery has another method called
slideToggle which does exactly what you want. It's just like
toggle except it only animates the height and keeps the width the same. Hooray!