FadeIn和fadeOut重复

时间:2013-05-25 16:12:59

标签: jquery html click fadein fadeout

当我快速单击#div几次时,会多次执行fadeIn和fadeOut。我想动画不会重复,如果我快速点击#div动画只执行一次。

代码:

$("#div").click(function(){
    $("#information").fadeIn(1200).fadeOut(1200);
});

对不起我的英文;)

1 个答案:

答案 0 :(得分:1)

尝试使用.stop()

$("#information").stop(true, true).fadeIn(1200).fadeOut(1200);

演示---> http://jsfiddle.net/S48RU/

相关问题