日期:2014-05-16 浏览次数:20368 次
<div class="newlist" id="c04">
<ul>
<li><span>26</span><em>1</em><a href="#" target="_blank">标题</a></li>
<li><span>26</span><em>2</em><a href="#" target="_blank">标题</a></li>
<li><span>26</span><em>3</em><a href="#" target="_blank">标题</a></li>
<li><span>26</span><em>4</em><a href="#" target="_blank">标题</a></li>
<li><span>26</span><em>5</em><a href="#" target="_blank">标题</a></li>
.....
</ul>
</div>
$(function(){
$('li' , '#c04').each(function(k){
if(k<3){
$('em' , this).addClass('emClass');
}else{
return false;
}
});
});
$(function(){
$('ul').each(function(){
$('li:lt(3) em',this).addClass('emClass');
});
});