How to use .animate() with a notification system

How to use .animate() with a notification system

Hello,

I'm quite a beginner with the JQuery framework. I'm building a very simple notification system showing at the top of the screen.

Here is my actual script :
  1. function msg(txt) {
  2.     if(txt) {
  3.         $("#message").html(txt);

  4.         $('#message').animate({
  5.             top: '14'
  6.         }, 1000, "easeOutBounce", function() {
  7.             // Animation complete
  8.             setTimeout(
  9.                 function() {
  10.                     $('#message').animate({
  11.                         top: '-66'
  12.                     }, 1000 )}, 1500);
  13.         });
  14.     }
  15. }
Explanation : a message appears from the top center of the screen with a bounce effect. After 1.5s the message disappears.

My problem is that if a second call is made within these 1.5s to the function message(), it's a bit buggy as my message disappears. 

I think the best way would be by cancelling the previous "hide" effect. I saw the clearQueue() function but I didn't really understood if that would help me.

Many thanks in advance for your advices!