jQuery函数.on适用于1.8.3但不适用于1.9.1

jQuery函数.on适用于1.8.3但不适用于1.9.1

问题描述:

我有一个与jQuery 1.8.3一起使用的功能,但是当我升级到1.9.1时,它不再起作用,但是文档没有变化。有人知道如何解决这个问题吗?

I have a function that works with jQuery 1.8.3 but when I upgrade to 1.9.1 it's not working anymore, but there's no change in documentation. Does somebody know how to fix this?

$(document).on("hover", "#cart-left", function(){
    $("#cart").addClass('active');
});

http://jsfiddle.net/michalcerny/R9HZp/

感谢您的支持!

在1.9.1中你应该使用 mouseover

In 1.9.1 you should use mouseover

$(document).on("mouseover", "#cart-left", function(){
    $("#cart").addClass('active');
});