更改 SimpleModal 对话框中的内部 HTML?
我正在使用 jQuery 表单插件的 beforeSubmit 函数来关闭模式对话框,并且我希望随后弹出另一个模式对话框,其中包含提交表单的结果,因此我在 success 函数中放置了另一个模式并传递通过responseText...但是新的模式对话框永远不会弹出...我怎样才能让它弹出?我还想知道如何更改对话框的innerHTML。我尝试了dialog.data.html(responseText);和其他一些东西,但都不起作用。
这是表单提交的代码:
$('#member_ban_forum').ajaxForm( {
data: { member: member }, beforeSubmit: function() {
$.modal.close();
},
success: function (responseText) {
$().delay(5000, function () {
simpleModal(responseText);
});
}
});
这是我制作的 simpleModal 弹出函数的代码:
function simpleModal ( html ) {
$(html).modal({
containerCss:{
height:340,
width:450
},
onOpen: function (dialog) {
dialog.overlay.fadeIn(350, function () {
dialog.container.fadeIn(350, function () {
dialog.data.slideDown(350);
});
});
},
onClose: function (dialog) {
dialog.data.slideUp(350, function () {
dialog.container.fadeOut(350, function () {
dialog.overlay.fadeOut(350, function () {
$.modal.close();
});
});
});
}
});
}
I'm using the beforeSubmit function of the jQuery form pluggin in order to close a modal dialog, and I want another one to popup after-wards with the result of the form being submitted, so I put another modal in the success function and passing through the responseText... but the new modal dialog never pops up... how can I get it to pop up? I would also like to know how to change the innerHTML of the dialog box. I tried dialog.data.html(responseText); and some other stuff, but none of it worked.
Here's the code for the form submit:
$('#member_ban_forum').ajaxForm( {
data: { member: member }, beforeSubmit: function() {
$.modal.close();
},
success: function (responseText) {
$().delay(5000, function () {
simpleModal(responseText);
});
}
});
Here's the code for the simpleModal popup function I made:
function simpleModal ( html ) {
$(html).modal({
containerCss:{
height:340,
width:450
},
onOpen: function (dialog) {
dialog.overlay.fadeIn(350, function () {
dialog.container.fadeIn(350, function () {
dialog.data.slideDown(350);
});
});
},
onClose: function (dialog) {
dialog.data.slideUp(350, function () {
dialog.container.fadeOut(350, function () {
dialog.overlay.fadeOut(350, function () {
$.modal.close();
});
});
});
}
});
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我可能是错的,但我认为问题出在您使用
delay()
上。以下对我有用:
I could be wrong, but I think the problem is with your use of
delay()
.The following works for me: