Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
264 views
in Technique[技术] by (71.8m points)

javascript - jQuery function .on works in 1.8.3 but not in 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/

Thanks for support!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In 1.9.1 you should use mouseover

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...