名称 | Css | jQuery |
第一个元素 | :first-child | :first, :first-child |
最后个元素 | :last-child | :last, :last-child |
偶数的元素 | :nth-child(even) | :even |
奇数的元素 | :nth-child(odd) | :odd |
大于给定索引值的元素 | :nth-child(n+2) | :gt(0) |
小于给定索引值的元素 | :nth-child(-1n+8) | :lt(2) |
CSS3 :nth-child()伪类选择器
http://www.cnblogs.com/kiracn/archive/2009/12/17/1626742.html
相关推荐
jQuery选择器分类应用.doc $的选择器部分: 凡是运用$,其返回值是一个object $选择器主要用于选择标签.基本用法是同css的选择器.但是,很让人兴奋的是,他支持常见的浏览器,而css中很多选择器是IE6所不支持的. 1....
支持基于 jQuery选择器CSS选择器引擎。 支持所有jQuery位置伪选择器: :first :last :eq :nth :gt :lt :even :odd :not(:positional) ,其中:positional是以上任意一项。 这个库是一个薄包装。 仅在实际...
* 参考: jquery css选择器 * 目前实现 * #id 根据给定的ID匹配一个元素 * tagName 匹配给定的元素名的所有元素 * .class 匹配class=class的所有元素 //非IE下,可以直接find * selector1,selector2 将每一个...
本文实例讲述了jQuery选择器选中最后一个元素,倒数第二个元素操作。分享给大家供大家参考,具体如下: HTML部分: 元素1 元素2 元素3 元素4 元素5 取倒数第二个p元素 $("div p").eq(-2) 取最后一个p元素...
选择器 基本 #id element .class * selector1,selector2,selectorN 层级 ancestor descendant parent > child prev + next prev ~ siblings 基本 :first :last :not :even :odd :eq :gt :lt :...
选择器 基本 #id element .class * selector1,selector2,selectorN 层级 ancestor descendant parent > child prev + next prev ~ siblings 基本 :first :last :not(selector) :even :odd :eq...
3. 选择器 37 3.1 基本 37 3.1.1 #id 37 3.1.2 element 38 3.1.3 .class 38 3.1.4 * 39 3.1.5 selector1,selector2,selectorN 39 3.2 层级 40 3.2.1 ancestor descendant 40 3.2.2 41 3.2.3 prev + next 41 3.2.4 ...
jQuery 1.1.3(2007年7月):这次小版本变化包含了对jQuery选择符引擎执行速度的显著提升。从这个版本开始,jQuery的性能达到了Prototype、Mootools以及Dojo等同类JavaScript库的水平。 jQuery 1.2(2007年9月):...
提示:jQuery 使用的语法是 XPath 与 CSS 选择器语法的组合。在本教程接下来的章节,您将学习到更多有关选择器的语法。 文档就绪函数 您也许已经注意到在我们的实例中的所有 jQuery 函数位于一个 document ready ...
选择器 基本 #id element .class * selector1,selector2,selectorN 层级 ancestor descendant parent > child prev + next prev ~ siblings 基本 :first :last :not :even :odd :eq :gt :lt :...
选择器 基本 #id element .class * selector1,selector2,selectorN 层级 ancestor descendant parent > child prev + next prev ~ siblings 基本 :first :last :not :even :odd :eq :gt :lt :...
选择器 基本 #id element .class * selector1,selector2,selectorN 层级 ancestor descendant parent > child prev + next prev ~ siblings 基本 :first :not(selector) :even :odd :eq(index) :...
这个函数接收一个包含 CSS 选择器的字符串,然后用这个字符串去匹配一组元素。 jQuery 的核心功能都是通过这个函数实现的。 jQuery中的一切都构建于这个函数之上,或者说都是在以某种方式使用这个函数。这个函数最...
child prev + next prev ~ siblings 基本 :first :last :not :even :odd :eq :gt :lt :header :animated 内容 :contains :empty :has :parent 可见性 :hidden :visible 属性 [attribute] [attribute=value] ...