php - How to disable the click on overlay to close Colorbox? - Stack Overflow

admin2025-04-21  0

I want to prevent colorbox close on cboxOverlay click

I'm using this code:

$.fn.colorbox({ overlayClose: false });

But it doesn't work.

I also disabled Esc close

$(document).bind("keydown.cbox_close", function (e) {

        if (e.keyCode === 27) {
               e.preventDefault();
               cboxPublic.close();
            }}); 

Esc code working properly .

But how to prevent colorbox close for overlay?

Thanks

I want to prevent colorbox close on cboxOverlay click

I'm using this code:

$.fn.colorbox({ overlayClose: false });

But it doesn't work.

I also disabled Esc close

$(document).bind("keydown.cbox_close", function (e) {

        if (e.keyCode === 27) {
               e.preventDefault();
               cboxPublic.close();
            }}); 

Esc code working properly .

But how to prevent colorbox close for overlay?

Thanks

Share Improve this question edited Oct 20, 2014 at 10:56 Barnee 3,4098 gold badges45 silver badges56 bronze badges asked Dec 4, 2012 at 9:19 Cake PHPCake PHP 1635 silver badges12 bronze badges 1
  • :) i found $(".ajax").colorbox({overlayClose: false}); – Cake PHP Commented Dec 4, 2012 at 9:30
Add a ment  | 

1 Answer 1

Reset to default 5

Shouldn't it be:

$.colorbox({ overlayClose: false });

See working demo here: Fiddle

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745177743a289006.html

最新回复(0)