I have a button that changes opacity when it is hovered: (works fine)
$('#btn').hover(function() {
$(this).animate({'opacity':1},100);
}, function() {
$(this).animate({'opacity':.8},100);
});
And when it is pressed it moves down: (works fine too)
$('#btn').on('click',function(){
$(this).animate({'margin-top':'-100px'},400);
});
Problem: When the button moves, it moves away from the hover area, but the first hover state is still active (the first hover state should only be active when the mouse is hovered over the button). However, if I move the mouse from there on, the second state triggers as jquery notice that mouse moves.
Is there any way for hover() to trigger even if mouse is not moved?