0
我需要懸停功能的「工人類型」和「你在哪裏工作?」在右側邊欄(在聯繫人的下方)變得更清潔。我需要的是對孩子UL當我現在將鼠標懸停在UL,而不僅僅是父鏈接仍然可見,如果我鼠標移出父鏈接jquery懸停不適用於子節點
這裏是我的代碼
<div class="nav_item">
<div class="nav_item_link" id="clickMe2" href="#"><img src="http://50.28.46.210/dev/obryan/wp-content/themes/wp-foundation/images/compassicon.png" class="nav_icons">
<h5>Where Do You Work?</h5></a>
</div>
<ul id="clickEvent2" class="worker_list">
<li><a href="http://dev.trafficdigitalagency.com/obryan/where-do-you-work/pacific-ocean/">Pacific Ocean</a></li>
<li><a href=""http://dev.trafficdigitalagency.com/obryan/where-do-you-work/atlantic-ocean/">Atlantic Ocean</a></li>
<li><a href="http://dev.trafficdigitalagency.com/obryan/where-do-you-work/gulf-of-mexico/">Gulf of Mexico</a></li>
<li><a href="http://dev.trafficdigitalagency.com/obryan/where-do-you-work/bering-sea/">Bering Sea</a></li>
<li><a href="http://dev.trafficdigitalagency.com/obryan/where-do-you-work/great-lakes/">Great Lakes</a></li>
<li><a href="http://dev.trafficdigitalagency.com/obryan/where-do-you-work/international-waters/">International Waters</a></li>
<li><a href="http://dev.trafficdigitalagency.com/obryan/where-do-you-work/mississippi-river/">Mississippi River</a></li>
<li><a href="http://dev.trafficdigitalagency.com/obryan/where-do-you-work/ohio-river/">Ohio River</a></li>
</ul>
</div>
這裏是我的jQuery
$(document).ready(function(){
$('#clickMe').hover(function() {
$("#clickEvent").fadeToggle("slow");
});
在你的例子中沒有'clickMe'。請澄清。 –
...如果你想讓懸停在ul上方保持打開狀態,那麼爲什麼事件不是綁定到'.nav_item'呢?編輯:借@Tim Wasson的jsFiddle:http://jsfiddle.net/4dvbL/1/ –