title: Using this with setTimeOut function stopped working
body: <p>I've created a function to loop through the divs in a parent div called 'rolloverimages' using an <code>.each</code> function. I want there to be a delay between when each image which is being generated so I am using <code>setTimeOut</code>. My problem is as soon as I added the setTimeOut function, the variables in using <code>this</code> aren't relating to the main <code>rollovers</code> variable.</p>
  
  <p>Can anyone help please?</p>
  
  <pre><code>function rolloverImages() {
  
      $('.thumbnail-wrapper').one('mouseover', function() {
          var rollovers = $(this).find('.rolloverimages div');
          var time = 0;
  
          rollovers.each(function() {
              setTimeout(function() {
                  var datasrc = $(this).data('hover');
                  var img = $('&lt;img id="dynamic"&gt;');
                  var imgsrc = img.attr('src', datasrc);
                  var parent = $(this).parent('.rolloverimages').parent('.thumbnail-wrapper');
                  console.log(parent);
              }, time);
              time += 2000;
          });
      }); 
  }
  </code></pre>