我想在jQuery中使not
运算符工作。它根本不工作。jQuery - 不是运营商没有按预期工作
悬停应在容器ca
工作,但它不应该其子容器上工作noHover
我的HTML结构:
<div class="ca" style="height:40%">
<div class="imageContainer">
<span class="hoverEffect">Some Image</span>
<span class="noHover">NH</span>
</div>
<div class="showContainer">
<span>New Image</span>
</div>
</div>
的jQuery:
$('.ca').not('.noHover').hover(function() {
$('.imageContainer', this).hide();
$('.showContainer', this).show();
}, function() {
$('.imageContainer', this).show();
$('.showContainer', this).hide();
});
“不工作” 是没用的。你需要解释你想要的代码做什么,以及它在做什么,你不想做什么(或者做什么不是你想做的事)。你想瞄准'.hoverEffect'吗? – Amadan
你想要这个 - http://jsfiddle.net/qsLg1ry5/5/ –
@Amadan更新了问题 – user2281858