javascript - ColorBox Onclose 函数不起作用

标签 javascript jquery colorbox

我正在尝试在关闭时打开一个新的颜色框窗口。

我正在使用这段代码:

$(".inline").colorbox({
    inline: true, 
    width: "50%", 
    escKey: false,
    onClose: function() {
        $('#newWindow').show();
    }

这段代码有什么问题吗?

最佳答案

描述

假设您使用 jack moore's colorbox jQuery plugin您必须将 onClose 更改为 onClosed 并使用 open:true而且您总是必须关闭该功能。

查看 jsFiddle Demonstration .

示例

HTML

<div class="firstColorBox">first</div>
<div class="secondColorBox">second</div>

jQuery

$(".firstColorBox").colorbox({
    inline:true, 
    width:"50%", 
    escKey:false,
    onClosed:function(){
        // open the other colorBox
        $(".secondColorBox").colorbox({
                inline:true, 
                width:"50%", 
                escKey:false,
                open:true
        });     
    }
});

更多信息

更新

关于javascript - ColorBox Onclose 函数不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8728419/

相关文章:

javascript - Angular Directive(指令)中的单选按钮不起作用

javascript - 表单验证失败但仍然提交

javascript - 选择后删除搜索字段中的文本

javascript - jQuery 颜色盒上没有下一个/上一个按钮

jquery - 为什么这个 div 的 z-index 高于模态(颜色框)?

javascript - 带画廊的 ColorBox

javascript - 使用 javascript 中的 html 浏览按钮捕获的文件名

javascript - 如何使用 dom 元素

javascript - 具有 Store 调度操作的 Angular 单元测试组件

java - 如何转义url中的#符号?