English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The show() method displays hidden elements.
Note:Hidden elements will no longer affect the layout of the page.
Note:If !important is used in the style, for example display: none !important, this method will not override !important.
Note:This method is applicable to elements hidden by jQuery methods, in CSS it is display:none (notvisibility: hidden).
This method is usually used withhide()Methods can be used together.
$(selector).show(duration, easing, callback)
Show all <p> elements when the button is clicked:
$("button").click(function(){ $("p").show(); });Test and see‹/›
UsedurationParameters:
$("button").click(function(){ $("p").show();1000); });Test and see‹/›
UsecallbackParameters:
$("button").click(function(){ $("div").show();1000, function(){ alert("DIV visible"); }); });Test and see‹/›
Animate all spans (in this example, words) to display quickly, and in200毫秒内完成每个动画:
$("button").click(function(){ -child $(this).next().show("fast", arguments.callee); }); });Test and see‹/›
Parameter | Description |
---|---|
duration | An optional value that determines how long the display effect will run. The preset value is400 milliseconds Possible values:
|
easing | An optional string that specifies the speed of the element at different points of the animation. The default value is "swing" Possible values:
|
callback | An optional function called once the show() method is completed for each selected element |