title: Javascript delay before showing message
body: <p>I have a simple JS script that shows few messages to website visitor.Bad thing is that JS is triggered when site is opened, and before user sees the message window, few messages are already shown.
  How can i delay showing the first message for few second?</p>
  
  <p>This is the code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          var bubbleMsg = ["First line of text", "Second line of text", "Third line of text"
                          ],//Bubble messages to show
              bubbleMsgSpeed = 3000;//Time between changing bubble text messages (in milliseconds)
      &lt;/script&gt; 
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$(document).ready(function () {
  
      /***** Bubble text *****/
  
      function BubbleText() {
  
          var msgSpeed = 3000;
          var textArray = ["Something here&lt;br/&gt;here", "And here"];
  
  
          if (typeof bubbleMsg != 'undefined')
              textArray = bubbleMsg;
  
          if (typeof bubbleMsgSpeed != 'undefined')
              msgSpeed = bubbleMsgSpeed;
  
          var $bubbleText = $(".bubble-text");
  
          var counter = 0;
  
          function ChangeText() {
              $bubbleText.html(textArray[counter]);
  
              counter++;
  
              if (counter &gt;= textArray.length) counter = 0;
          }
  
          ChangeText();
  
          setInterval(ChangeText, msgSpeed);
  
      }
  
      BubbleText();
  </code></pre>