简体   繁体   English

如何处理jQuery UI中的模式对话框淡出?

[英]How do I handle modal dialog fadeout in jQuery UI?

At http://jqueryui.com/demos/dialog/#modal-form , there is a sample modal dialog; http://jqueryui.com/demos/dialog/#modal-form处 ,有一个示例模态对话框。 when you click on "Create new user", it displays a modal dialog and fades everything but the dialog. 当您单击“创建新用户”时,它将显示一个模式对话框,并淡化除对话框之外的所有内容。

On my work based on that, I've specified "modal: true," and the modal dialog appears and disappears appropriately, but nothing else is greyed out; 在此基础上,我指定了“ modal:true”,并且出现了模态对话框,并适当地消失了,但是没有其他显示为灰色。 the rest of the screen looks as it looked before. 屏幕的其余部分与以前一样。

Do I need to apply additional CSS or serve up an image? 我是否需要应用其他CSS或提供图片? A brief look at the sample source code didn't make it clear what I need to be adding so that it greys out the background. 简要查看示例源代码并不清楚我需要添加什么,以便使背景变灰。

If I need to have other static content served up, how can I serve it up under a Django /static/ tree? 如果需要提供其他静态内容,如何在Django / static /树下提供它? In other words, do I need to make /foo/ and /bar/ additional static content directories, or will it work with subdirectories of /static/? 换句话说,我是否需要创建/ foo /和/ bar /其他静态内容目录,或者它可以与/ static /的子目录一起使用?

When you're passing modal:true as one of the options to ui-dialog, there should be an overlay div element created with a high z-index and a classname of ui-widget-overlay assigned to it. 当您将modal:true作为ui-dialog的选项之一传递时,应该创建一个覆盖div元素,该元素具有较高的z-index和为其分配的ui-widget-overlay类名。 If you decided to write your own stylesheets rather than use one of the available ones as a template, it could just be that you need to define the ui-widget-overlay class in your stylesheets, set its opacity etc. 如果您决定编写自己的样式表,而不是使用可用样式表中的一个作为模板,则可能只是需要在样式表中定义ui-widget-overlay类,设置其不透明度等。

Do you have the appropriate theme files in the correct place on the server? 您在服务器上正确的位置有适当的主题文件吗? If you aren't using a standard default theme you can create your own using jQuery UI's theme roller. 如果您使用的不是标准默认主题,则可以使用jQuery UI的主题滚子创建自己的主题。

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

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