首頁  >  效果  > hide([s,[e],[fn]])

返回值:jQueryhide([speed,[easing],[fn]])

jQuery hide() 方法概述

隱藏顯示的元素

這個就是 'hide( speed, [callback] )' 的無動畫版。如果選擇的元素是隱藏的,這個方法將不會改變?nèi)魏螙|西。

參數(shù)

speed[,fn]Number/String,FunctionV1.0

speed:三種預定速度之一的字符串("slow","normal", or "fast")或表示動畫時長的毫秒數(shù)值(如:1000)

fn:在動畫完成時執(zhí)行的函數(shù),每個元素執(zhí)行一次。

[speed],[easing],[fn]Number/String,String,FunctionV1.4.3

speed:三種預定速度之一的字符串("slow","normal", or "fast")或表示動畫時長的毫秒數(shù)值(如:1000)

easing:(Optional) 用來指定切換效果,默認是"swing",可用參數(shù)"linear"

fn:在動畫完成時執(zhí)行的函數(shù),每個元素執(zhí)行一次。

示例

描述:

隱藏所有段落

jQuery 代碼:
$("p").hide()

描述:

用600毫秒的時間將段落緩慢的隱藏

jQuery 代碼:
$("p").hide("slow");

描述:

用200毫秒將段落迅速隱藏,之后彈出一個對話框。

jQuery 代碼:
$("p").hide("fast",function(){
   alert("Animation Done.");
 });