关闭后如何打开另一个彩盒?

时间:2012-06-15 21:46:36

标签: jquery jquery-plugins colorbox

如何在关闭后打开另一个彩盒?

这是我到目前为止所做的:

$(document).ready(function () {    
     $(".signup, .load, #loop a[href='#signup_box'], .signup_sidebar").colorbox({
        inline : true,
        innerWidth : 600,
        innerHeight : 600,
        escKey : false,
        arrowKey : false,
        fixed : true,
        onClosed:function(){
          interrupt();
        }
      })
    //...    
    interrupt = function ($) {
      $('#footer .stage .interrupt').colorbox({
        inline : true,
        innerWidth :  '600px',
        innerHeight : '600px',
        escKey :      false,
        arrowKey :    false,
        fixed :       true
      });
    };
});

每当我在文档中对此进行初始化时,我都会收到一条错误消息,指出未定义颜色框。我认为这是一个范围问题,但我不确定如何解决这个问题。

1 个答案:

答案 0 :(得分:0)

interrupt定义更改为

interrupt = function () { ... }

不确定为什么你期望$作为参数,但这不是必要的,并且会导致问题。