我有這個jquery片段,它在鼠標懸停上顯示隱藏超鏈接,我的問題是一個嵌套列表,如果我將鼠標懸停在一個孩子父母將被顯示。如何顯示實際的超鏈接徘徊conatinerjquery mousenter顯示超鏈接徘徊的容器
$("div.dd3-content, div.dd-action-handle")
.mouseenter(function() {
$(this).parent().find('div.dd-action-handle a').show();
})
.mouseleave(function() {
$(this).parent().find('div.dd-action-handle a').hide();
});
HTML
<ol class="dd-list">
<li class="dd-item dd3-item" data-id="22">
<button type="button" data-action="collapse">Collapse</button>
<button type="button" data-action="expand" style="display: none;">Expand</button>
<div class="dd-handle dd3-handle"></div>
<div class="dd3-content"><href="#" class="editable editable-click" data-url="/post" data-pk="22">some</href="#"></div>
<div class="dd-action-handle">
<a href="/admin/dashboard/get_menu_item/22" data-toggle="modal" data-target="#editModal" class="edit_menu" style="display: none;"><i class="fa fa-pencil fa-2x"></i></a>
<a style="margin-left: 10px; display: none;" href="#" class="remove_menu"><i class="fa fa-times-circle fa-2x"></i></a>
</div>
<ol class="dd-list">
<li class="dd-item dd3-item" data-id="23"> <div class="dd-handle dd3-handle"></div><div class="dd3-content"><href="#" class="editable editable-click" data-url="/post" data-pk="23">Tutorials</href="#"></div><div class="dd-action-handle">
<a href="/admin/dashboard/get_menu_item/23" data-toggle="modal" data-target="#editModal" class="edit_menu" style="display: none;"><i class="fa fa-pencil fa-2x"></i></a>
<a style="margin-left: 10px; display: none;" href="#" class="remove_menu"><i class="fa fa-times-circle fa-2x"></i></a>
</div>
</li>
</ol>
</li>
</ol>
http://jsfiddle.net/lgtsfiddler/dSaVU/
你可以分享你的HTML? – Felix
您能否將您的標記添加到問題中? – monners
我貼一些html – fefe