1. 程式人生 > >jquery 的主要知識

jquery 的主要知識

所有 query jquery jquery對象 插入 pro fun cte sele

獲取jquery對象:
$("選擇器") jQuery("選擇器");
jquery對象>>dom對象
方式1:
jquery對象.get(index);

方式2:
jquery對象[index]
dom對象>>jquery對象
$(dom對象)

頁面載入
$(function(){})

派發事件
jquery對象.事件(function(){...});

選擇器:
#id值 .class值 標簽名 [屬性] [屬性=‘值‘]
a b:後代 a>b:孩子 a+b:大弟弟 a~b:所有弟弟
:first :last :odd :even :eq|gt|lt(index)
:hidden
:checked :selected
屬性和css:
prop|attr
css

文本 標簽體
val()
html() text()

文檔處理
內部插入
append prepend
外部插入
after before
刪除
remove
效果:
隱藏|顯示
show() hide()
淡入淡出
fadeIn() fadeOut()
滑入滑出
slideDown() slideUp()

遍歷
jquery對象.each(function(){
});

jquery 的主要知識