I have an existing call to open an iframe colorbox when a link of class “iframe” is clicked:
$(".iframe").colorbox({iframe:true, width:"200px", height:"500px"});
I’d like to add a callback to this colorbox to trigger a function when it’s about to open:
onOpen:function(){ alert('colorbox is about to open'); }
but where does this code go? I tried adding it to the colorbox() but then the whole thing fails. I’m a bit confused.
it goes as an option as below:
Or
and here is a working example.