欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jquery子元素過濾選擇器使用示例

 更新時(shí)間:2013年06月24日 15:03:37   作者:  
jquery子元素過濾選擇器在某些特殊的情況下還是比較實(shí)用的,下面為大家介紹下具體的使用方法,感興趣的各位可以參考下哈
復(fù)制代碼 代碼如下:

:nth-child('索引值')//獲取指定元素下的某個(gè)子元素的位置,索引從1開始;
//偶數(shù)行
//$('li:nth-child(even)').addClass('class1');
//奇數(shù)行
//$('li:nth-child(odd)').addClass('class1');

//第一行
//$('li:nth-child(1)').addClass('class1');
//$('li:first-child').addClass('class1');

//只有1個(gè)子元素
$('li:only-child').addClass('class1');

相關(guān)文章

最新評(píng)論