jQuery hover() only triggers when mouse move -
i have button changes opacity when hovered: (works fine)
$('#btn').hover(function() { $(this).animate({'opacity':1},100); }, function() { $(this).animate({'opacity':.8},100); });
and when pressed moves down: (works fine too)
$('#btn').on('click',function(){ $(this).animate({'margin-top':'-100px'},400); });
problem: when button moves, moves away hover area, but first hover state still active (the first hover state should active when mouse hovered on button). however, if move mouse there on, second state triggers jquery notice mouse moves.
is there way hover() trigger if mouse not moved?
use $(this).trigger("mouseout")
this cause correct hover()
handler fire.
Comments
Post a Comment