2011-05-31 52 views
1

如何将border-bottom : none;添加到活动<li>之上的<li>jQuery:选择li在活动之上

<ul> 
    <li>text</li> <!--this li must get the border-bottom : none then.--> 
    <li class="active">text</li> 
    <li>text</li> 
</ul> 

回答

3
$('.active').prev('li').css('border-bottom','none'); 
+0

它不工作。这是一个jQuery新闻旋转。所以如果你用鼠标来确定项目,它必须改变。 这里的图像,看看我的意思: http://www.dreamwire.nl/klanten/test.jpg – Maanstraat 2011-05-31 12:00:56

+0

你的意思是悬停?如果是这样,请尝试与此结合:http://api.jquery.com/hover/ – 2011-05-31 12:09:33

+0

是的,我现在正在工作......但是当我在ul之外时,您将再次看到边框! – Maanstraat 2011-05-31 12:50:33

3
$('li.active').prev().css('border-bottom', 'none');