The .slideToggle()
method animates the height of the matched elements. This causes lower parts of the page to slide up or down, appearing to reveal or conceal the items. If the element is initially displayed, it will be hidden; if hidden, it will be shown. The display
property is saved and restored as needed. If an element has a display
value of inline
, then is hidden and shown, it will once again be displayed inline
. When the height reaches 0 after a hiding animation, the display
style property is set to none
to ensure that the element no longer affects the layout of the page.