title: Suspend Default Event in jQuery
body: <p>I am trying to delay the default event or events in a jQuery script. The context is that I want to display a message to users when they perform certain actions (click primarily) for a few seconds before the default action fires.</p>
  
  <p>Pseudo-code:
  - User clicks link/button/element
  - User gets a popup message stating 'You are leaving site'
  - Message remains on screen for X milliseconds
  - Default action (can be other than href link too) fires</p>
  
  <p>So far, my attempts look like this:</p>
  
  <pre><code>$(document).ready(function() {
      var orgE = $("a").click();
      $("a").click(function(event) {
          var orgEvent = event;
          event.preventDefault();
          // Do stuff
          doStuff(this);
  
          setTimeout(function() {
              // Hide message
              hideMessage();
              $(this).trigger(orgEvent);
          }, 1000);
      });
  });
  </code></pre>
  
  <p>Of course, this doesn't work as expected, but may show what I'm trying to do.</p>
  
  <p><strong>I am unable to use plugins as ths is a hosted environment with no online access.</strong></p>
  
  <p>Any ideas?</p>