Latest web development tutorials

jQuery hide () method

jQuery Effect Methods jQuery Effect Methods

Examples

Hide all <p> elements:

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

try it"

Definition and Usage

hide () method to hide selected elements.

Note: This CSS property display: none similar.

Note: The hidden element is not completely displayed (no longer affects the layout of the page).

Tip: To hide the display element, check show () method.

grammar

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

参数 描述
speed 可选。规定隐藏效果的速度。

可能的值:

  • 毫秒
  • "slow"
  • "fast"
easing 可选。规定在动画的不同点上元素的速度。默认值为 "swing"。

可能的值:

  • "swing" - 在开头/结尾移动慢,在中间移动快
  • "linear" - 匀速移动
提示:扩展插件中提供更多可用的 easing 函数。
callback 可选。hide() 方法执行完之后,要执行的函数。

如需学习更多有关 callback 的内容,请访问我们的 jQuery Callback 这一章。



Examples

More examples

hide () - use speed parameter
When the Hide / Show element, how to use speed parameter.

hide () - the use of callback parameters
When the Hide / Show element, how to use the callback parameter.


jQuery Effect Methods jQuery Effect Methods