When an element is hidden from view using display:none;
we can easily show the element using the slideDown()
method. This method may take the following form:
jQuery(elements).slideDown([duration], [easing] [callback]);
The optional duration argument may take either integer or string formats just like the animation methods we have already looked at, and the default duration of 400 milliseconds will be used when no duration argument is supplied.
As before, an easing function may also be supplied as the second argument, and a callback function, if supplied, will be executed once for each selected element once the animation has completed.
The slideDown()
method works by changing an element's display
property from none
to block
in the same way that fade animations do. If an element requires a different display mode, such as inline-block
for example, this will need to be set using the optional callback function, or by using a nested element within the element that has slideDown...