检测Facebox何时关闭

时间:2011-01-11 08:04:44

标签: jquery-ui jquery

当旧的facebox关闭时,我需要触发一个新的facebox。

这就是我现在这样做的方式,但我觉得可以有更优雅的方式。

  

function process(){

step1(step2);

//triggers the first facebox
function step1(cb){
  $.facebox(1);
  $("#facebox .finished").click(function(event){
    cb();
  });
};

function step2(){
  $.facebox(2);
}   }

1 个答案:

答案 0 :(得分:5)

$(document).bind('afterClose.facebox', cb);

或者,您可以发出自己的自定义事件。