.animate()
遅延とイージングを含むすべての要素の機能が完了した後にのみ、機能をトリガーしようとしています。
いくつかの異なる方法を試しましたが、運がありませんでした。アイデアはありますか?
$("#inner_work").on("mouseenter", ".activeBox", function(){
var thisBox = $(this).attr('id');
$("#inner_work [class^='workBox_']").each(function(){
if($(this).attr('id') != thisBox){
$(this).stop().delay(randomEasing(200,800)).animate({
opacity:0
}, randomEasing(200,700));
} else {
$(this).stop().animate({
opacity:1
}, 'fast');
}
});
});
すべてのアニメーションが完了した後にイベントをトリガーするにはどうすればよいですか?
randomEasing
ランダムにずらして作るのはこの機能だけです
function randomEasing(from,to)
{
return Math.floor(Math.random()*(to-from+1)+from);
}