Detecting when Facebox is closed
I need to trigger a new facebox when the old one is closed.
This is the way I am doing it now, but I feel there can be a more elegant way.
function process(){
step1(step2); 开发者_C百科//triggers the first facebox function step1(cb){ $.facebox(1); $("#facebox .finished").click(function(event){ cb(); }); }; function step2(){ $.facebox(2); } }
$(document).bind('afterClose.facebox', cb);
Or, you can emit your own custom event.
精彩评论