Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
请看这个小提琴。它有一个悬停时显示的按钮。
现在尝试更改为 jQuery 1.9.0,并注意 Fiddle 中断。
我用错了toggle()吗?这是我的错,还是 jQuery 的错误?
toggle()
hover伪事件不再存在,请改用 mouseenter 和 mouseleave 。
hover
$('#user-rows').on('mouseenter mouseleave', '.user-row', function () { $(this).find('.edit').toggle(); });
http://jsfiddle.net/MgcDU/1337/
http://jquery.com/upgrade-guide/1.9/#hover-pseudo-event