views:

38

answers:

2

Hi guys,

I am using facebox in one of my projects. Is there a event to get the close/hide event of the box? onHide is not available ?

+2  A: 

Checkout the doc's for it: http://github.com/defunkt/facebox/blob/master/facebox.js#L52

$(document).bind('close.facebox', function () {
    // Facebox is closing :O
});
Matt
Hi Matt, Thanks for the quick response. Small question, I have a web page, inside that I have a iframe, Inside the iframe I am using the facebox. so when facebox comes up i want it to show in the full page, not inside the iframe. is it possible to show it like this ?
kakopappa
@kakopappa: Is the iframe on the same domain as your page?
fudgey
Yes same domain,
kakopappa
A: 

you can access the parent window of the iframe with window.parent so here is what you should have.

jQuery(function(){
  jQuery("a[rel*=facebox]").click(function () { 
    window.parent.$.facebox({ ajax: 'remote.html' });
  });
});

that is assuming you use the 'rel' attribute to load facebox modals!

Neo