2011-05-31 72 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');