Basic Element Visibility in jQuery

Out of the box, jQuery comes with basic methods to show and hide elements. There is a live example here of the functions listed in this post.

slideToggle slide the element up/down to It handles the toggle state automatically so you don't need to define a separate state boolean.


toggle fades and shrinks the element to the upper left, again toggle state is handled automatically.


fadeIn and fadeOut perform a fade and collapse/expand the element.



In the above examples the parameter "slow" can also be set to "normal", "fast" or a number in milliseconds.


Add comment