Move span with jquery

0

I'm doing a span move when I place the mouse over a button, and when I shoot the mouse it returns to the starting position. I'm using jquery's animate class, the only problem is that when I hover the mouse several times over the button it continues to run the animation several times. What I wanted to do is, when I move the mouse over and exit, if I pass over again the continue function of where the span is.

Here's my code:

$("button#icone-seta-move").mouseover(function(){ $("span#icone-seta").animate({"margin-left":"207px", "opacity":"1"},400); }); $("button#icone-seta-move").mouseout(function(){ $("span#icone-seta").animate({"margin-left":"190px", "opacity":"0"},400); });

    
asked by anonymous 13.05.2018 / 03:46

0 answers