In jQuery, the .animate() method could be used to create an animation of the height of an element by smoothly changing its height - and any other CSS properties - over a specified duration. This will provide user experience with smooth transitions.
Syntax:
$(selector).animate({ height: "newHeight" }, duration);
newHeight: The CSS height value (for example "300px", "50%", or "toggle" to toggle between visible and hidden).
duration: The duration of the animation - can be one of "slow", "fast", or any number in millisecond.