简体   繁体   English

更改jQuery UI模式对话框的堆栈顺序

[英]changing stack order of jQuery UI modal dialogs

I'm popping up two jQuery UI modal dialogs. 我正在弹出两个jQuery UI模式对话框。 One of them is triggered on the success of an AJAX function, so it usually comes up later, on top of the first dialog. 其中一个是在AJAX函数成功时触发的,所以它通常会在第一个对话框之后出现。 I'd like to programmatically switch the stacking order of the two dialogs so that the first appears on top of the second. 我想以编程方式切换两个对话框的堆叠顺序,以便第一个出现在第二个对话框的顶部。 Trying to do this with the zIndex property and with dialog("moveToTop"), but neither seem to be having an effect. 尝试使用zIndex属性和对话框(“moveToTop”)执行此操作,但似乎都没有效果。 Suggestions? 建议?

I realized a sample that should work for you: http://jsfiddle.net/kUYcw/ . 我意识到了一个适合你的样本: http//jsfiddle.net/kUYcw/

In this example, if you remove the stack:false and stack:true options, the dialog d2 (second one) will appear first. 在此示例中,如果删除stack:falsestack:true选项,则会首先显示对话框d2 (第二个)。

But, in the example I put in the link, you can see that I forced jQuery to display d1 first. 但是,在我放入链接的示例中,您可以看到我强制jQuery首先显示d1

EDIT: 编辑:

I've just updated the code. 我刚刚更新了代码。 You can find it here: http://jsfiddle.net/DQYEW/3/ . 你可以在这里找到它: http//jsfiddle.net/DQYEW/3/

As you can see, the dialog d2 will show when d1 calls the close event. 如您所见,对话框d2将显示d1何时调用close事件。

Regards. 问候。

根据Zakaria的帖子,我认为Drew意味着: http//jsfiddle.net/pinusnegra/KqK6n/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM