First of all, there’s no spinner in the fancybox, just the string “Content”. Assuming you have that .loader div in the fancybox, have you tried the afterClose callback? Like
$('#myBtn').click(function() {
$.fancybox({
type: 'inline',
// Clone the content from a certain element
// which includes the .loader div
content: $('.content').clone(),
// Always hide the .loader when the popup
// got closed
afterClose: function() {
$('.loader').hide();
}
});
});
Also, it would be advisable to actually abort the AJAX request when you’re dismissing the response anyway, like
var req;
$('#myBtn').click(function() {
$.fancybox({
type: 'inline',
content: $('content').clone(),
afterClose: function() {
$('.loader').hide();
if (req) {
req.abort();
}
}
});
});
// Then, later
req = $.ajax({ /* etc. */});
While typing the above I also noticed that the parentheses of the AJAX call are missing in your snippet. It would really be helpful if you posted code examples as they are supposed to work, i.e. that do not contain additional bugs and syntax errors we’d have to fix first if we wanted to run your code in a fiddle or something. ;-)