jQuery API 返回首页目录 | jQuery API 中英文对照版
fadeOut(speed, callback)
fadeOut(speed,callback)

通过不透明度的变化来实现所有匹配元素的淡出效果,并在动画完成后可选地触发一个回调函数。

这个动画只调整元素的不透明度,也就是说所有匹配的元素的高度和宽度不会发生变化。

返回值:jQuery

参数:

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

示例:

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

示例:

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

 
fadeOut( speed, callback )

Fade out all matched elements by adjusting their opacity and firing an optional callback after completion.

Only the opacity is adjusted for this animation, meaning that all of the matched elements should already have some form of height and width associated with them.

Return value: jQuery
Parameters:

  • speed (String|Number): (optional) 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").fadeOut("slow");  

Example:

 $("p").fadeOut("slow",function(){     alert("Animation Done.");   });  
相关链接
asp之家 | jQuery官方网站 | jQuery中文网 | 电子书作者网站 | 电子书作者blog