title: Javascript setTimeout not working as expected
body: <p>I have a small function:</p>
  
  <pre><code>function showVotingModal(e) {
  
      var $collector = $("#vote-collector");
  
      setTimeout(function () {
  
          $collector.addClass("open");
      }, 5000);
  
      $collector.find(".description").text($(this).data("desc"));
      $collector.attr("data-id", "15");
  
  }
  </code></pre>
  
  <p>The idea is to show the #vote-collector panel after a delay of 5 seconds and populate some further data withing the panel.</p>
  
  <p>The above code works, however the code below doesn't.</p>
  
  <pre><code>function showVotingModal(e) {
  
      setTimeout(function () {
          var $collector = $("#vote-collector");
          $collector.addClass("open");
          $collector.find(".description").text($(this).data("desc"));
          $collector.attr("data-id", "15");
  
   }, 5000);
      }
  </code></pre>
  
  <p>In this case the 'description' tag isn't populated.</p>
  
  <p>Can anyone throw some light on whether I'm doing something wrong, or does the timeout function simply does not work this way?</p>
  
  <p>Thanks</p>