title: Do-While Loop Not Working | TimeOut might be the problem HTML and JS
body: <p>I am trying to create a growing/shrinking effect with WebGL.<br />
  I approached this problem by using setTimeout().<br />
  I incorporated a <strong>do-while loop</strong> so that this process can repeat</p>
  <p>However, the growing/shrinking only occurs <strong>once</strong>.</p>
  <p>My Code:</p>
  <pre class="lang-js prettyprint-override"><code>document.getElementById(&quot;groNShrink&quot;).onclick = function()
    {
    var millisecondsToWait = 500;
    var max                = 3; // Max times
    do
      {
      balloonEffect++;
      for (var i = 0; i &lt; max; i++)
        {
        setTimeout(function () 
          {
          changeRadius /= 1.15;
          }
          , millisecondsToWait * i);
        }
      setTimeout(function ()
        {
        for (var x = max; x !== 0; x--) 
          {
          setTimeout(function () 
            {
            changeRadius *= 1.15;
            }
            , millisecondsToWait * x);
          }
        }
        , millisecondsToWait * max);
      } 
    while (balloonEffect % 2 == 0);
    };
  </code></pre>
  <p>This is just my for my do-while loop.<br />
  I don't see where I went wrong maybe another pair of eyes will help.</p>