bobmarleylyrics
New Member
I'm having trouble closing my fancy box in some cases after an ajax call.\[code\] $(document).ajaxStop(function() { function(){$.fancybox.close()}; }); $(document).ajaxStart(function() { $("a#load_gif").trigger('click'); });\[/code\]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\[code\]$(document).ajaxStop(function() { setTimeout(function(){$.fancybox.close()},500);});\[/code\]But honestly that solution is not good looking. What can I do to make the fancy box close even if the ajax call is returned very fast? The length of the ajax call is variable depending on the number of rows it has to fetch.Any help and/or suggestions are appreciated.