15分钟搞定jQuery
- jQuery特点
- CSS选择器用法
- jQuery集合
- jQuery集合操作
- 获取匹配元素的值
- DOM元素遍历
- 事件处理
- 安静加载运行
- 对象链串访问
- 疯狂链串(Crazy Chaining)
- Ajax用法
- 推荐了几个插件
------------------------------------------------------------------------------------------------------
What makes jQuery interesting?
• Built around CSS selectors
• Well behaved
• Doesn’t hijack your global namespace
• Plays well with other libraries
• API designed with conciseness and convenience as the driving factors
-------------------------------------------------------------------------------------------------------
The jQuery() function
jQuery('div#intro h2')
jQuery('div.section > p')
jQuery('input:radio')
$('div#intro h2')
--------------------------------------------------------------------------------------------------------
jQuery collections
• $('div.section') returns a jQuery collection
• You can call methods on it:
$('div.section').size() = no. of matched elements
$('div.section').each(function(div) {
// Manipulate the div
}
---------------------------------------------------------------------------------------------------------