Colorbox - 从特定窗口中删除关闭按钮

Yae*_*ael 15 jquery colorbox

我正在使用colorbox插件在我的网页上显示消息.其中一个是"等待响应"消息,我不希望用户自己关闭它.

我知道如何取消绑定ESC键,并禁用叠加关闭,但我仍然有关闭按钮的问题.我发现我可以在css中删除它:#cboxClose {display:none!important;}但这会影响我的所有彩盒信息..

有没有办法从特定邮件中删除关闭按钮?也许来自jsp本身?

谢谢,Yael.

ntz*_*lis 34

如何通过jquery打开此特定框后删除按钮.Colorbox为您提供必要的事件挂钩:

$('selector').colorbox({onLoad: function() {
    $('#cboxClose').remove();
}});
Run Code Online (Sandbox Code Playgroud)

  • 更好的是:onOpen - >`$("#colorbox").addClass("noClose");`,onClosed - >`$("#colorbox").removeClass("noClose");`,和css:` .noClose #cboxClose {display:none}` (4认同)

bjt*_*ley 8

谢谢ntziolis这正是我想要的.我能够像这样将它添加到我的colorbox调用中.我用它打开一个单独的网页,注意iframe:true

$(".class_name").colorbox({innerWidth:500, innerHeight:400, iframe:true, escKey:false, overlayClose:false,onLoad: function() {
    $('#cboxClose').remove();
}});
Run Code Online (Sandbox Code Playgroud)


Goh*_*ran 7

在较新版本的colorbox中有一个选项

closeButton true设置为false以删除关闭按钮.

看到这里 http://www.jacklmoore.com/colorbox/

closeButton:false