jQuery API jQuery API 中英文对照版 - jQuery在线查询手册
hide(speed,callback)
hide(speed,callback)

以优雅的动画隐藏所有匹配的元素,并在显示完成后可选地触发一个回调函数。 可以根据指定的速度动态地改变每个匹配元素的高度、宽度和不透明度。

返回值:jQuery

参数:

  • speed (String|Number): 三种预定速度之一的字符串("slow", "normal", or "fast")或表示动画时长的毫秒数值(如:1000)
  • callback (Function): (可选) 在动画完成时执行的函数

示例:

$("p").hide("slow");

示例:

$("p").hide("slow",function(){ alert("Animation Done."); });

 
hide( speed, callback )

Hide all matched elements using a graceful animation and firing an optional callback after completion.

The height, width, and opacity of each of the matched elements are changed dynamically according to the specified speed.

Return value: jQuery
Parameters:

  • speed (String|Number): A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).
  • callback (Function): (optional) A function to be executed whenever the animation completes, executes once for each element animated against.

Example:

 $("p").hide("slow");  
Example:
 $("p").hide("slow",function(){     alert("Animation Done.");   });