0
我有一个使用jQTools覆盖和jQuery .ajax提交例程的窗体。一旦显示成功/错误消息,我希望叠加层关闭。我如何将纳入一个setTimeout的这个(成功/错误味精已经显示后,才)覆盖的ID是“#overlayForm”jQuery setTimeout覆盖提交
$.ajax({
type: $(form).attr('method'),
url: form.action,
data: dataString,
clearForm: true,
success: function (data) {
if (data == "Mail sent") {
$("#formWrap, #supportHdln").hide();
$("#thankYou").html('<h2><span>Thank You | </span>We have received your request.</h2><p>A Customer Service Representative from Kinetick will contact you shortly</p>').fadeIn("slow");
} else {
$("#formWrap, #supportHdln").hide();
$("#error").html('<h2"><span>Uh Oh | </span>We have encountered an error in your submission.</h2><p> Please check that all required form fields were filled out, if that does not resolve the issue, please <a href="mailto:[email protected]?subject=Cancelling Kinetick Account Help">email</a> us here.</p>').fadeIn("slow");
}
}
});
return false;
}
我已经编辑我的答案正是 – netadictos 2010-10-22 17:07:43
感谢我需要的东西!我可以将贴近的按钮应用于叠加层中的一个按钮,但该功能将为我执行此操作,并且我可以删除关闭按钮! – 2010-10-22 18:24:44
经过一番测试,以上只是使内容消失。我可以在叠加调用本身中添加一个“onLoad”函数,但是从显示表单的时候就会触发,我需要它在提交表单时启动定时器。有任何想法吗? – 2010-10-22 18:56:33