3

这是dealio:我有一张桌子。当您将鼠标悬停在它上面时,jQuery 会添加一些编辑按钮。当您将鼠标移出桌子时,它们就会消失。问题是,如果您将鼠标移入表格,然后移到按钮上,然后移出,它们会保持原位。我怎样才能解决这个问题?

JsFiddle -> http://jsfiddle.net/kthornbloom/LHZdd/1/

简化代码:

$(document.body).on("mouseover", ".edit table", function (e) {
    $('.jr-columnmodifier, .jr-rowmodifier').remove();
    $('<div class="button"></div>').appendTo(this);
});

$(document.body).on("mouseleave", ".edit table, .button", function (e) {
    $('.button').remove();
});
4

1 回答 1

4

我没有为什么的答案,但似乎mouseenter不是:mouseover

http://jsfiddle.net/P3FMQ/

$(document.body).on("mouseenter", ".edit table", function (e) {
于 2013-10-31T20:26:40.350 回答