我想选择一个具有id属性的ul。它有li标签,在li标签内有锚标签。当我将鼠标移出时,我希望ul及其中的所有元素都被隐藏起来。如何使用Jquery选择一个id和一个子标签?
$('#switch-fighters-results-list').mouseout(function(){
$(this).hide();
});
这里是标记
<div style="display: block;" id="switch-fighters-results" class="ajax-search-results">
<ul id="switch-fighters-results-list" class="ajax-search-results-list clrFx">
<li onmouseout="removeCurrent(this);" onmouseover="addCurrent(this);" class="">
<a href="/fighter/scott/ferrozzo/56">Scott Ferrozzo</a>
</li>
<li onmouseout="removeCurrent(this);" onmouseover="addCurrent(this);" class="">
<a href="/fighter/scott/bessac/63">Scott Bessac</a>
</li>
<li onmouseout="removeCurrent(this);" onmouseover="addCurrent(this);" class="">
<a href="/fighter/scott/adams/191">Scott Adams</a>
</li>
<li onmouseout="removeCurrent(this);" onmouseover="addCurrent(this);" class="">
<a href="/fighter/scott/junk/362">Scott Junk</a>
</li>
<li onmouseout="removeCurrent(this);" onmouseover="addCurrent(this);" class="">
<a href="/fighter/scott/smith/376">Scott Smith</a>
</li>
<li onmouseout="removeCurrent(this);" onmouseover="addCurrent(this);" class="">
<a href="/fighter/scott/baker/555">Scott Baker</a>
</li>
</ul>
<div id="switch-fighter-more-results">
<a id="switch-fighter-more-results-link">13 more found for <span class="input-string">'scott'</span> »</a>
</div>
</div>
你可以发布你的标记 – Galen 2011-04-19 15:25:40