jQuery API 返回首页目录 | jQuery API 中英文对照版
lt(pos)
lt(pos)

将匹配的元素集合缩减为给定位置之前的所有元素。这个元素在匹配元素集合中的位置变为0,而长度变成1。

返回值:jQuery

参数:

  • pos (Number): 把集合缩减为这个位置之下的所有元素
 

示例:

$("p").lt(1)

HTML 代码:

<p>This is just a test.</p><p>So is this</p>

结果:

[ <p>This is just a test.</p> ]

 

lt( pos )

Reduce the set of matched elements to all elements before a given position. The position of the element in the set of matched elements starts at 0 and goes to length - 1.

Return value: jQuery
Parameters:

  • pos (Number): Reduce the set to all elements below this position.
 

Example:

 $("p").lt(1)  
Before:
 <p>This is just a test.</p><p>So is this</p>  

Result:

 [ <p>This is just a test.</p> ]  


相关链接
asp之家 | jQuery官方网站 | jQuery中文网 | 电子书作者网站 | 电子书作者blog