为什么 jQuery UI 1.10 删除 jquery 对话框 zIndex 选项? [英] Why jQuery UI 1.10 remove jquery dialog zIndex option?

查看:27
本文介绍了为什么 jQuery UI 1.10 删除 jquery 对话框 zIndex 选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现最新版本的 jQuery UI(1.10) 删除了 zIndex 选项.并且在 jQuery 网站上得到了确认.

I found the latest version of jQuery UI(1.10) remove the zIndex option. And it's confirmed on the jQuery website.

这真的让我震惊.请考虑一下:

It really shocked me. Please think about this:

当我们有一个jqgrid,用editrow()或者addrow()打开一个编辑对话框来编辑一些东西,里面有很多字段,一些有自定义事件,比如当你点击它时,它会显示另一个 jQuery 对话框来显示一些树状视图项目供选择.

When we have an jqgrid, and use editrow() or addrow() to open a edit dialog to edit something, and there are many fields inside, some of which have self-defined event, such as, when you click it, it will show another jQuery dialog to show some treeview items to chose.

在 jQuery UI 1.9(包含)下,您可以将 jQuery 对话框的 zIndex 选项设置为大于 jqgrid 编辑对话框的(jqgrid 编辑对话框支持设置 zIndex),所以jQuery 对话框总是打开并且可以看到和使用.

Under jQuery UI 1.9 (included), you can set the jQuery dialog's zIndex option to bigger than the jqgrid edit dialog's (jqgrid edit dialog support set zIndex), so the jQuery dialog always be upon and could be seen and used.

在jQuery UI 1.10下,不能设置zIndex,所以jQuery对话框总是在jqgrid编辑对话框后面.

Under jQuery UI 1.10, you cant set zIndex, so the jQuery dialog is always behind the jqgrid edit dialog.

我觉得这样的场景很常见.

I think such scene is very common.

为什么 jQuery UI 1.10 移除了 jQuery 对话框 zIndex 选项?多个对话框时如何控制z-index顺序?

Why jQuery UI 1.10 remove jQuery dialog zIndex option? How to control the z-index order when there is more than one dialog?

推荐答案

我想我理解你的问题.jQuery UI 对话框的 CSS z-index 不够高,无法始终显示在您的内容上方.这是一个快速修复:

I think I understand your problem. The CSS z-index for the jQuery UI dialog is not high enough to always show above your content. Here's a quick fix:

/* A class used by the jQuery UI CSS framework for their dialogs. */
.ui-front {
    z-index:1000000 !important; /* The default is 100. !important overrides the default. */
}

这篇关于为什么 jQuery UI 1.10 删除 jquery 对话框 zIndex 选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆