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:
- foreach(...){
- var el = jQuery('<div></div>');
- el.click(function() {
- jQuery.colorbox({
- iframe:true,
- target: ...,
- ...
- onCleanup:function(){
- // till here everything works fine
- // But now the console log has the focus of the last element
- console.log(el);
- }
- });
- }
- }
Thanks for your help!
Best,
Theo