jQuery Effectsshow()Method

jQuery 效果方法jQuery Effects Methods

Example

Show all hidden <p> elements:

$("button").click(function(){ $("p").show(); });

Try it Yourself »

Definition and Usage

The show() method displays the hidden selected elements.

Note:show() works on elements hidden with jQuery methods and CSS display:none (not applicable to elements hidden with visibility:hidden).

Tip:To hide elements, see thehide()method.


Syntax

$(selector).show(speed,easing,callback)

Parameter Description
speed Optional. Specifies the speed of the display effect.

Possible values:

  • Milliseconds
  • "slow"
  • "fast"
easing Optional. Specifies the speed of the element at different points in the animation. Default value is "swing".

Possible values:

  • "swing" - moves slowly at the beginning/end, fast in the middle
  • "linear" - moves at a constant speed
Tip:More available easing functions are provided in extension plugins.
callback Optional. The function to execute after the show() method has finished.

To learn more about callbacks, visit ourjQuery Callbackchapter.



实例

More Examples

show() - using the speed parameter
How to use the speed parameter when hiding/showing elements.

show() - using the callback parameter
How to use the callback parameter when hiding/showing elements.


jQuery 效果方法jQuery Effects Methods

Other Extensions