问题
When I quickly click a #div several times, fadeIn and fadeOut is performed several times. I would like the animation is not repeated, if I quickly click #div animation perform only one time.
Code:
$("#div").click(function(){
$("#information").fadeIn(1200).fadeOut(1200);
});
Sorry for my english ;)
回答1:
Try using .stop()
$("#information").stop(true, true).fadeIn(1200).fadeOut(1200);
Demo --->
http://jsfiddle.net/S48RU/
来源:https://stackoverflow.com/questions/16751458/fadein-and-fadeout-repeat