【发布时间】:2012-10-30 19:15:55
【问题描述】:
当您将鼠标悬停在 <div> 上时,我希望页面的单独部分上的 <a> 也可以“悬停”在上面。
<div class="initiator">
</div>
<div>
<a class="receiver href="#">Touch the div and I get hovered!</a>
</div>
我试过这个 jQuery,但它不会触发 <a> 的悬停 CSS。
$(".initiator").hover(function(){
$(".receiver").hover();
console.log("div was hovered");
});
【问题讨论】:
-
doesn't trigger the <a>'s hover CSS.可能是您的 css 中不够具体的问题
标签: javascript jquery html hover bind