title: Only setTimeout executes function. JS
body: <p>I am trying to implement kind of player on my website.
  If press <code>'Play'</code> button, the music starts and the page smoothly scrolls down. 
  But when you press <code>'Mute'</code> button <code>(function(){music.volume=0})</code> I am not sure why the page appears at the top again. <code>window.scroll()</code> doesn't do anything without delay. So i am using <code>setTimeout</code> function to scroll the page on the current place. The problem is that in Opera and IE <code>setTimeout</code> takes about <code>10 ms</code>, so when i click <code>'Mute'</code> button i see like ticks to top and back. In chrome it takes only <code>2 ms</code> and there is no problems.
  Now when i decide to create my own timeout function the <code>window.scroll()</code> does not work again.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>var isMuted = false;
  muteButton.onclick = function() {   ////This function works with big delay.
      if (!isMuted) {
          mainAudio.volume = 0;
          isMuted = true;
      } else {
          mainAudio.volume = bgAudioTrackVolume;
          isMuted = false;
      }
      setTimeout(function() {
          window.scroll(0, offset); /// Works
      }, 0)
  };
  </code></pre>
  
  <p>Change setTimeout with:</p>
  
  <pre><code>i = 9542155.873; /// I have tried delay time from 1ms - 250ms by changing this value.
  while (i &gt; 0.00001) {
      i = i / 1.0001234567;
      if (i &lt; 0.00001) {
          window.scroll(0, offset); /// Does not do anything. Strange! Have tried to change variable with a number.
      }
  }
  </code></pre>
  
  <p>Every time i check offset value, it is always available before calling scroll function.
  I know that my problem is not usual and i am realy need your help.</p>