Colorbox - removing the close button from a specific window

Yael picture Yael · Apr 21, 2010 · Viewed 29.3k times · Source

I'm using the colorbox plugin to display messages on my web page. One of them is a "wait for response" message, and I don't want the user closing it by himself.

I know how to unbind the ESC key, and to disable the overlay close, but I still have a problem with the close button. I found I could remove it in the css like this: #cboxClose{display:none !important;} but this will effect all my colorbox messages..

Is there a way to remove the close button from a specific message? Maybe from the jsp itself?

Thanks, Yael.

Answer

ntziolis picture ntziolis · Apr 21, 2010

What about removing the button after this specific box has opened via jquery. Colorbox provides you with the necessary event hook:

$('selector').colorbox({onLoad: function() {
    $('#cboxClose').remove();
}});