title: mvc3 Ajax.ActionLink and delaying LoadingElementId from showing
body: <p>I have a progress div which absolute positions across the top of the web page.</p>
  
  <p>When I click on a Ajax.ActionLink, sometimes I see it flicker at the top when the request/response is just short of instant.</p>
  
  <p>How can I add a delay so that the progress banner does not show for 500ms?</p>
  
  <p>thank you</p>
  
  <p><strong>Here is the working code</strong></p>
  
  <pre><code>var showProgress = false;
  function AjaxBegin()
  {
      showProgress = true;
      setTimeout("if (showProgress) { $('#progress').show(); }", 800);
  
  }
  function AjaxComplete()
  {
      showProgress = false;
      $("#progress").hide();
  }
  function AjaxFailure(ajaxContext)
  {
      var response = ajaxContext.responseText;
      alert("Error Code [" + ajaxContext.ErrorCode + "] " + response);
  }
  </code></pre>
  
  <p>AjaxOptions</p>
  
  <pre><code>InsertionMode = InsertionMode.Replace;
  OnFailure = "AjaxFailure";
  OnBegin = "AjaxBegin";
  OnComplete = "AjaxComplete";
  HttpMethod = "GET";
  </code></pre>