Problem with Scope

Problem with Scope

Hi,
I have a problem with the item-scope.
I'm creating multiple elements, that are opening a colorbox on click and "onCleanup"(colorbox) the triggering element should be changed. But the focus is set to the last element, not at the triggering element.
How can adress the correct element? 

here is the code:
  1. foreach(...){
  2.       var el = jQuery('<div></div>');
  3.       el.click(function() {
  4.             jQuery.colorbox({
  5.                   iframe:true, 
  6.                   target: ...,
  7.                   ...
  8.                   onCleanup:function(){
  9.                         // till here everything works fine
  10.                         // But now the console log has the focus of the last element
  11.                         console.log(el);
  12.                   }
  13.             });
  14.       }
  15. }

Thanks for your help!
Best,
Theo