私は.box
divを持っていて、クリックすると展開します。
問題は、そのdivを何度も高速クリックすると、クリックイベントによって新しいアニメーションがトリガーされ、クリックごとにアニメーションが実行されることです。
HTML
<div class="box">
<div class="title">
<label>Some title</label>
</div>
<div class="text">
<label>Some text that is longer then the title text</label>
</div>
</div>
JQuery
$('.box').toggle(function() {
$(this).attr("selected", "true");
$(this).animate({"height": "529px", "width": "460px"}, "slow");
},function() {
$(this).animate({"height": "163px", "width": "220px","z-index":"10"}, "slow");
});
アニメーションが一度終了するまで、どういうわけかクリックを無効にしたいです。
それは可能ですか?