Jquery Safari浏览器中的Mouseenter和mouseleave事件

Jquery Safari浏览器中的Mouseenter和mouseleave事件,jquery,safari,Jquery,Safari,我试图使用jQuery在菜单页面中连接一些简单的鼠标事件。它在Chrome和IE9中工作得很好,但在Safari中,当我移动鼠标时,高亮显示会卡在某些元素上。下面是显示页面的3个浏览器。你将不得不想象这一点,因为我不被允许发布屏幕截图的链接。对不起 以下是连接事件的代码: $(document).ready(function() { $("#number").focus(); // We use td elements instead of anchors as the me

我试图使用jQuery在菜单页面中连接一些简单的鼠标事件。它在Chrome和IE9中工作得很好,但在Safari中,当我移动鼠标时,高亮显示会卡在某些元素上。下面是显示页面的3个浏览器。你将不得不想象这一点,因为我不被允许发布屏幕截图的链接。对不起

以下是连接事件的代码:

$(document).ready(function() {

    $("#number").focus();

    // We use td elements instead of anchors as the menu items. The ones we want to work with all have 
    // a custom attribute called url that stores the url template...
    var linkCells = $("td[url]");

    // Wire up the click handler for each link cell...
    linkCells.click(function () {
        Navigate($(this).attr('url'));
    });

    // Wire up mouse events for the link cells. We want to highlight the current cell and update
    // the number label...
    linkCells.bind('mouseenter mouseleave', function(e) {
        var linkCell = $(this);
        linkCell.toggleClass('linkOn');
        if(e.type == 'mouseenter') {
            $("#numberLabel").html('<b>' + linkCell.attr('numberLabel') + '</b>');
        }
    });

    // Wire up the submit event in case the user presses the Enter key instead of clicking a link...
    $("#Form1").submit(function() {
        Navigate($("#lastLink").val());
        return false;
    });
});
$(文档).ready(函数(){
$(“#编号”).focus();
//我们使用td元素而不是锚作为菜单项。我们想要使用的所有元素都有
//一个名为url的自定义属性,用于存储url模板。。。
var linkCells=$(“td[url]”);
//为每个链接单元格连接单击处理程序。。。
链接单元格。单击(函数(){
导航($(this.attr('url'));
});
//连接链接单元格的鼠标事件。我们要突出显示当前单元格并进行更新
//号码标签。。。
linkCells.bind('mouseenter mouseleave',函数(e){
var linkCell=$(此值);
linkCell.toggleClass('linkOn');
如果(e.type=='mouseenter'){
$(“#numberLabel”).html(“”+linkCell.attr('numberLabel')+“”);
}
});
//连接提交事件,以防用户按Enter键而不是单击链接。。。
$(“#Form1”).submit(函数(){
导航($(“#lastLink”).val());
返回false;
});
});
有没有什么特殊的技巧可以让Safari和其他浏览器表现得一样

谢谢


Matthew MacFarland

你试过使用hover吗?()是否也发生了同样的行为?能否创建一个简单的JSFIDLE在safari上进行测试?请在屏幕截图上发布一个链接。工作正常,至少有我的屏幕截图链接: