返回值:jQueryhide([speed,[easing],[fn]])
jQuery hide() 方法概述
隱藏顯示的元素
這個(gè)就是 'hide( speed, [callback] )' 的無動畫版。如果選擇的元素是隱藏的,這個(gè)方法將不會改變?nèi)魏螙|西。
參數(shù)
speed[,fn]Number/String,FunctionV1.0
speed:三種預(yù)定速度之一的字符串("slow","normal", or "fast")或表示動畫時(shí)長的毫秒數(shù)值(如:1000)
fn:在動畫完成時(shí)執(zhí)行的函數(shù),每個(gè)元素執(zhí)行一次。
[speed],[easing],[fn]Number/String,String,FunctionV1.4.3
speed:三種預(yù)定速度之一的字符串("slow","normal", or "fast")或表示動畫時(shí)長的毫秒數(shù)值(如:1000)
easing:(Optional) 用來指定切換效果,默認(rèn)是"swing",可用參數(shù)"linear"
fn:在動畫完成時(shí)執(zhí)行的函數(shù),每個(gè)元素執(zhí)行一次。
示例
描述:
隱藏所有段落
jQuery 代碼:
$("p").hide()
描述:
用600毫秒的時(shí)間將段落緩慢的隱藏
jQuery 代碼:
$("p").hide("slow");
描述:
用200毫秒將段落迅速隱藏,之后彈出一個(gè)對話框。
jQuery 代碼:
$("p").hide("fast",function(){
alert("Animation Done.");
});