There is a form in the fancybox window. It is necessary that after the form is successfully sent a window pops up with the text about the successful submission. How best to implement this? The form processing code is $("#calc").submit(function() { var form_data = $(this).serialize(); $.ajax({ type: "POST", url: "/send-ajax.php", data: form_data, success: function() { $.fancybox.close(); } }); }); call window code with form
$('.buy_button').fancybox({ afterClose: function () { $.fancybox.open('#done'); } }); But with such a call, the overlay overlaps the new window and it hangs for a very short time. Are there any alternatives?