Answer the question
In order to leave comments, you need to log in
How to make a popup window after submitting a form?
$("#form1").submit(function () {
var th = $(this);
$.ajax({
type: "POST",
url: "mail.php", //Change
data: th.serialize()
}).done(function () {
// код после успешной отправки формы
});
return false;
});
$("#form1").submit(function () {
var th = $(this);
$.ajax({
type: "POST",
url: "mail.php", //Change
data: th.serialize()
}).done(function () {
// код после успешной отправки формы
$.fancybox({
href: '#thx',
openEffect: 'elastic',
closeEffect: 'elastic',
afterLoad: function() {
setTimeout(function() {
parent.$.fancybox.close({
closeEffect: 'elastic'
});
}, 3000);
}
});
});
return false;
});
Answer the question
In order to leave comments, you need to log in
$.fancybox.open({
src : '#hidden-content',
type : 'inline',
opts : {
onComplete : function() {
console.info('done!');
}
}
});
here it is recommended to stupidly trigger a click event on the desired element
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question