Categories
Development jQuery

My jQuery animate() runs 2 times, how to fix this?

I’ve made some animation with the animate function of jQuery. When the function launches it runs 2 times; the div goes down, goes back up and goes finally go back down.

I dont know how to fix this.

$("#p1 br").css("display","none");
$("#p12 br").css("display","none");
$("#p13 br").css("display","none");

$("#cryptosmart").mouseover(function() {
  $("#cryptobox").animate({top: "1403.5px"});
  $("#cryptopass").css("top","1591.5px");
});
$("#cryptosmart").mouseout(function() {
  $("#cryptobox").animate({top: "1201px"});
  $("#cryptopass").css("top","1389px");
});
$("#cryptobox").mouseover(function() {
  $("#cryptopass").css("top","1591.5px");
});
$("#cryptobox").mouseout(function() {
  $("#cryptopass").css("top","1389px");
});

Leave a Reply

Your email address will not be published. Required fields are marked *