How to simulate a close() in facebox

bragboy picture bragboy · Jun 17, 2010 · Viewed 10.4k times · Source

I am using facebox popup in one of my pages. I am having a button in the popup dialog. When I click that button the facebox popup should close (the same way it closes when we press outside the popup). How to do that?

Also, I am doing some Ajax stuff when that button is being pressed so I cannot override the onClick event.

Answer

Matt Briggs picture Matt Briggs · Jun 17, 2010
$(function() {
  $('#button-id').click($.facebox.close);
});

as long as you aren't actually setting event handlers through onclick, adding handlers won't override existing ones.