http://www.jbxue.com/article/15278.html
基本動畫方法:show(),hide() ; fadeIn(),fadeOut();slideUp(),,slideDown()
1,show()方法和hide()方法
$("selector").show()
從display:none還原元素默認或已設置的display屬性
$("selector").hide()
設置元素的display樣式爲none,等於$("selector").css("display","none")
(注: 傳入參數後,.show()和.hide()方法同時動畫改變元素的width,height和透明屬性;傳入參數控制顯隱速度,單位毫秒, 如.show(600),也可傳入fast,normal,slow,fast爲200毫秒,normal爲400毫秒,slow爲600毫秒)
2,fadeIn()方法和fadeOut()方法
$("selector").fadeIn()
控制透明度在指定時間內從display:none提高至完全顯示
$("selector").fadeOut()
控制透明度在指定時間內降低至display:none;
3,slideUp()方法和slideDown()方法
$("selector").slideUp()
控制元素高度在指定時間內從下到上縮短至display:none;
$("selector").slideDown()
控制元素高度在指定時間內從display:none延伸至完整高度
4,自定義動畫方法animate()
$("selector").animate(style,speed, easting,callback);
style:一個包含樣式屬性及值的映射,比如{property1:"value1",property2:"value2",...}
speed:速度參數,可選
easting:可選的歡動類型
callback:在動畫完成時執行的參數(即回調函數),可選
$("selector").animate({properies},{options});