2017年6月1日
摘要: 缩写搜索元素的范围 三个最基本的过滤方法是:first(), last() 和 eq(),它们允许您基于其在一组元素中的位置来选择一个特定的元素。 其他过滤方法,比如 filter() 和 not() 允许您选取匹配或不匹配某项指定标准的元素。 jQuery first() 方法 first() 方 阅读全文
posted @ 2017-06-01 14:01 IT-HourseMan 阅读(372) 评论(0) 推荐(0) 编辑
摘要: 在 DOM 树中水平遍历 有许多有用的方法让我们在 DOM 树进行水平遍历: siblings() next() nextAll() nextUntil() prev() prevAll() prevUntil() jQuery siblings() 方法 siblings() 方法返回被选元素的所 阅读全文
posted @ 2017-06-01 13:58 IT-HourseMan 阅读(191) 评论(0) 推荐(0) 编辑
摘要: jQuery children() 方法 children() 方法返回被选元素的所有直接子元素。 该方法只会向下一级对 DOM 树进行遍历。 您也可以使用可选参数来过滤对子元素的搜索。 下面的例子返回类名为 "1" 的所有 <p> 元素,并且它们是 <div> 的直接子元素: jQuery fin 阅读全文
posted @ 2017-06-01 13:54 IT-HourseMan 阅读(429) 评论(0) 推荐(0) 编辑
摘要: 遍历 - 祖先 向上遍历 DOM 树 这些 jQuery 方法很有用,它们用于向上遍历 DOM 树: parent() parents() parentsUntil() jQuery parent() 方法 parent() 方法返回被选元素的直接父元素。 该方法只会向上一级对 DOM 树进行遍历。 阅读全文
posted @ 2017-06-01 09:32 IT-HourseMan 阅读(391) 评论(0) 推荐(0) 编辑