javascript - Animate div on hover and mouseleave with delay -
I have a blue diva, which should be animated on the hover on the green box.
Place the cursor on a green box for a long time, the blue divis spreads when you move the cursor away, the blue color goes back to its original size.
But if you move the mouse quickly to a green color, then nothing should be done. This part of this behavior is really my question, how to solve it?
$ ('# c'). Hover (function () ($ ('# nav'). Delay (150). ({'Top': '- 10px', 'left': '- = 10px', 'width': '+ = 20px' 'Height': '+ = 20px', 'background-color': 'orange (' at the top: '+ = 0px', 'left') '}, {duration: 200});}, function () { Stop (true). (150): '+ = 0px', 'width': '- = 0px', 'height': '- = 0px', 'background-color': $ ('# NAV'). 'Blue'}, {duration: 200});}); Chetan ({'top': '+ = 10px', 'left': '+ = 10px', 'width': '$' ('# c'). Mouseleave (function () {$ ('# nav') . - = 20px ',' height ':' - = 20px ',' background-color ':' blue '}, {duration: 100});});
Here you go to mouseleave Is that the animation is complete or not: var hovered = false; $ ('# C') Hover (function () ($ ('# NAV'). Delay (150) .Met ({'top': '- = 10px', 'left': '- = 10px', 'Width': '+ = 20px ',' Height ':' + = 20px ',' background-color ':' orange '}, 200, function () {hovered = true;}}}}, function () {$ (' # nava '). Allow (true). Dele (150). Permission ({'Top': '+ = 0px', 'left': '+ = 0px', 'width': '- = 0px', 'height': '- = ('Hovered == true) {hovered = false; $ (' # '); $ (' # '); $ (' # '). Nav '). ({' Top ':' + = 10px ',' left ':' + = 10px ',' width ':' - = 20px ',' height ':' - = 20px ',' background-color ':' Blue '}, 100);}});
Comments
Post a Comment