如何使div浮动在jQuery UI对话框上方? [英] How to get a div to float above a jQuery UI dialog?

查看:141
本文介绍了如何使div浮动在jQuery UI对话框上方?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有表单的jQuery对话框,我希望附加到表单元素之一的自动完成框浮动在对话框上方(这样,如果列表超出对话框的末尾,不会被切断).我将以下CSS元素应用于自动填充div:

I have a jQuery dialog box with a form and I'd like for an autocomplete box attached to one of the form elements to float above the dialog box (so that if the list goes beyond the end of the dialog box, it won't get cut off). I have the following CSS elements applied to the autocomplete div:

background:none repeat scroll 0 0 white;
float:left;
position:absolute;
z-index:9999;

它仍然会在对话框中创建一个滚动条.这是怎么回事?我看到对话框是z-index:1004;所以我不知道为什么我的不去做.我想完成的事情甚至有可能吗?

It still will create a scrollbar in the dialog box. What's the deal? I see the dialog box is z-index:1004; so I don't know why mine's not going ontop of it. Is what I'm trying to accomplish even possible?

推荐答案

发生这种情况的原因是,您的元素是对话框容器的子级. z-index不会做您想要的.该元素将需要在对话框外部并相应地定位.

The reason it happens is because your element is a child of the dialog's container. z-index won't do what you want. The element would need to be outside the dialog and positioned accordingly.

这篇关于如何使div浮动在jQuery UI对话框上方?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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