on() 不支持hover事件

 

因为 .hover() 是 jQuery 自己定义的事件… 是为了方便用户绑定调用 mouseenter 和 mouseleave 事件而已,它并非一个真正的事件,所以当然不能当做 .bind() 中的事件参数来调用。

 

    $("body").on("mouseenter","#standard-answer tr",function(){
        var n = $(this).index();
        $("body").find("#student-answer tr").eq(n).css("background","#AFFCF7");    
        });
    $("body").on("mouseleave","#standard-answer tr",function(){
        var n = $(this).index();
        $("body").find("#student-answer tr").eq(n).css("background","");    
        });

 

posted @   boyanh  阅读(906)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示