Fancybox not closing after ajax call
问题 I'm having trouble closing my fancy box in some cases after an ajax call. $(document).ajaxStop(function() { function(){$.fancybox.close()}; }); $(document).ajaxStart(function() { $("a#load_gif").trigger('click'); }); Here's my code handling the fancy box. So my problem is that if the ajax call is very brief and fast the box doesn't close, however if the call is longer it closes automatically as it should. I have found a fix which goes along the line of this $(document).ajaxStop(function() {