jQuery Effect - show() Method
Example
Show the hidden <p> element.
$(".btn2").click(function(){ $("p").show(); });
Definition and Usage
If the selected element is hidden, then show these elements:
Syntax
$(selector).show(speed,callback)
Parameter | Description |
---|---|
speed |
Optional. Specifies the speed at which the element becomes fully visible from hidden. The default is "0". Possible values:
In the case of setting the speed, the element will gradually change its height, width, margin, padding, and opacity during the process of becoming fully visible from hidden. |
callback |
Optional. The function to be executed after the show function is executed. For more information about callback, please visit our jQuery Callback chapter. This parameter cannot be set unless speed is set. |
Tips and Notes
Tip:If the element is already fully visible, this effect does not produce any change unless a callback function is specified.
Note:This effect applies to elements hidden by jQuery, or elements declared display:none in CSS (but not elements with visibility:hidden).
More Examples
- Use the speed parameter
- Use the speed parameter to hide and show elements.
- Use the speed and callback parameters
- Use the speed and callback parameters to hide and show elements.