2016-12-29 10 views
1

私は別のアニメーションをやろうとしています。したがって、最初のアニメーションが完了するまで、2番目のアニメーションが機能します。今、最初のアニメーションだけが動作します。jqueryで1つのアニメーション

<script> 

$(document).ready(function() { 

$('.white-area-comments').animate({ 
scrollTop: $('.white-area-comments').prop('scrollHeight') 
}, 800); 


$('#your-rank').fadeIn('slow'); 
}); 
</script> 

答えて

0

あなたはアニメーションが、それが完了しています一度解決しますPromiseを返すことができます:

$('.white-area-comments') 
    .animate({ ... }, 800) 
    .promise() 
    .done(function() { 
     $('#your-rank').fadeIn('slow'); 
    }); 

は、アニメーションのためにDocumentation

関連する問題