nth-last-of-type selector
描述: 选择所有他们父级兄弟元素下具有相同的元素名(注:标签名,比如<li>)的倒数第n个子元素,计数从最后一个元素开始到第一个。
- 
                
添加的版本: 1.9jQuery( ":nth-last-of-type(index/even/odd/equation)" )
index: 每个相匹配子元素的索引值,从最后一个开始(
1),也可以是字符串even或odd,或一个方程式( 例如:nth-last-of-type(even),:nth-last-of-type(4n)) 
因为jQuery的实现:nth-是严格来自CSS规范,n值是“1-indexed”,也就是说,从1开始计数。对于所有其他选择器表达式比如:eq() 或 :even ,jQuery遵循JavaScript的“0索引”的计数。因此,给定一个单一<ul>包含3个<li>, $('li:nth-last-of-type(1)')选择第3个,也就是最后一个<li>。
这个不寻常的用法,可进一步讨论中找到W3C CSS specification.
例子:
Example: 在每个匹配的ul中查找倒数第二个li,并将它标记出来。
| 
					
						 1 
					
						2 
					
						3 
					
						4 
					
						5 
					
						6 
					
						7 
					
						8 
					
						9 
					
						10 
					
						11 
					
						12 
					
						13 
					
						14 
					
						15 
					
						16 
					
						17 
					
						18 
					
						19 
					
						20 
					
						21 
					
						22 
					
						23 
					
						24 
					
						25 
					
						26 
					
						27 
					
						28 
					
						29 
					
						30 
					
						31 
					
						32 
					
						33 
					
						34 
					
				 | 
				
					
  | 
			
Demo:
Example: This is a playground to see how the selector works with different strings.
| 
					
						 1 
					
						2 
					
						3 
					
						4 
					
						5 
					
						6 
					
						7 
					
						8 
					
						9 
					
						10 
					
						11 
					
						12 
					
						13 
					
						14 
					
						15 
					
						16 
					
						17 
					
						18 
					
						19 
					
						20 
					
						21 
					
						22 
					
						23 
					
						24 
					
						25 
					
						26 
					
						27 
					
						28 
					
						29 
					
						30 
					
						31 
					
						32 
					
						33 
					
						34 
					
						35 
					
						36 
					
						37 
					
						38 
					
						39 
					
						40 
					
						41 
					
						42 
					
						43 
					
						44 
					
						45 
					
						46 
					
						47 
					
						48 
					
						49 
					
						50 
					
						51 
					
						52 
					
						53 
					
						54 
					
						55 
					
						56 
					
						57 
					
						58 
					
						59 
					
						60 
					
						61 
					
						62 
					
				 | 
				
					
  |