ajax表单提交建议后的简单灯箱
我正在寻找一个灯箱,我可以在提交联系表单后使用它向用户提供反馈,我已经查看了一些示例,但我想要一些简单的建议。
的代码
var automaticOnSubmit = cname.form.onsubmit;
cname.form.onsubmit = function(){
var valid = automaticOnSubmit();
if(valid){
$(".load").show();
$.post("http://dw.inside-the-internet.com/thewp/wp-content/themes/dwtemplate/process.php",
$("#cform").serialize(),
function(data){
if($.trim(data) == 'sent') {
//i am looking to do something here with a simple lightbox messsage ????
$(".sent").hide();
$(".load").fadeOut();
setTimeout(function() {
$('.sent').fadeIn();
}, 3500);
window.setTimeout(function() {
window.location.href = 'http://dw.inside-the-internet.com';
}, 9000);
}else{
alert(data);
$(".load").hide();
}
});
}
这是我看过
http://jquery.com/demo/thickbox/ 等,但它们一切似乎都太过分了,
请帮忙 返回假; }
I am looking for a lightbox that i can use to give the user feedback after my contact form has been submitted, i have looked at a few examples but i want something simple any suggesttions.
Heres my code
var automaticOnSubmit = cname.form.onsubmit;
cname.form.onsubmit = function(){
var valid = automaticOnSubmit();
if(valid){
$(".load").show();
$.post("http://dw.inside-the-internet.com/thewp/wp-content/themes/dwtemplate/process.php",
$("#cform").serialize(),
function(data){
if($.trim(data) == 'sent') {
//i am looking to do something here with a simple lightbox messsage ????
$(".sent").hide();
$(".load").fadeOut();
setTimeout(function() {
$('.sent').fadeIn();
}, 3500);
window.setTimeout(function() {
window.location.href = 'http://dw.inside-the-internet.com';
}, 9000);
}else{
alert(data);
$(".load").hide();
}
});
}
i have looked at http://jquery.com/demo/thickbox/ etc
but they all seem overkill
any help please
return false;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
嗨 jqmodal 是一个非常好的简单且可自定义的 JQuery 模式框插件,他们的网站很完整示例,它的使用就像您想要的一样简单和强大:)
HTH!
Hi jqmodal is a very nice simple and customizable modal box plug in for JQuery their web site is full of examples and it use is as simple and powerful as you want :)
HTH!
我建议使用 jQuery UI 库中的模式对话框 - 这将非常方便地满足您的需求。
I would suggest using a modal dialog from the jQuery UI library - this would meet your needs quite handily.
这里有一些建议
Here are a few suggestions