Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.toggle() example doesn't work with jQuery 1.9

Please see this Fiddle. It has a button that displays on hover.

Now try changing to jQuery 1.9.0, and notice that the Fiddle breaks.

Am I wrongly using toggle()? Is this my fault, or a bug with jQuery?

like image 262
Randomblue Avatar asked Sep 05 '26 21:09

Randomblue


1 Answers

the hover pseudo event no longer exists, use mouseenter and mouseleave instead.

$('#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

like image 98
Kevin B Avatar answered Sep 07 '26 14:09

Kevin B



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!