【问题标题】:mouseover bug in IE 9 when using an scrollable div?使用可滚动 div 时 IE 9 中的鼠标悬停错误?
【发布时间】:2014-08-14 09:40:37
【问题描述】:

我在article 元素上使用mouseovermouseout 事件,似乎每次我在元素内滚动时,这两个事件都会在Internet Explorer 9 中再次触发。 p>

$(document).on('mouseover', 'article', function () {
    console.log("over!");
});

$(document).on('mouseout', 'article', function () {
    console.log("out!");
});

Live demo

article 元素可以动态创建。这就是hover 未被使用的原因。

HTML

<article>
    <div class="box">Text</div>
    <div class="box">Text</div>
    <div class="box">Text</div>
    <div class="box">Text</div>
    <div class="box">Text</div>
</article>


CSS

article {
    overflow:auto;
    height:200px;
    background:#ccc;
}

【问题讨论】:

  • 您是否尝试过:mouseentermouseleave
  • @singe31 谢谢!它似乎可以解决问题。如果您将其添加为答案,我会接受。

标签: javascript jquery css internet-explorer-9


【解决方案1】:

尝试在您的活动中使用mouseentermouseleave 而不是mouseovermouseout

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-04-18
    • 1970-01-01
    • 2011-10-03
    • 1970-01-01
    • 2019-03-03
    • 1970-01-01
    • 2010-12-12
    相关资源
    最近更新 更多