colorbox
colorbox copied to clipboard
Disable click on image triggering next image?
Hi, I am trying to combine colorbox with wheelzoom. But I have not found a way to disable the click listener on the image. So if i try to zoom and den move the image around, it will switch to the next image instead of dragging the current.
Is it possible to disable the click listener on the image?
There isn't an option to disable that, but you could use the onComplete (or cbox_complete event) to remove the onclick value. For example:
$('a.example').colorbox({onComplete: function(){
$('.cboxPhoto')[0].onclick = null;
}});
Thanks that works for me.
@jackmoore thanks for pointing the right direction; I had to use
onComplete: function(){ $('.cboxPhoto').unbind('click'); }
the unbind wouldn't work in the document.ready otherwise and the .onclick=null wouldn't do anything