简体   繁体   English

jQuery对话框-如何获取.ui-widget-shadow作为父元素?

[英]jQuery dialog - how to get .ui-widget-shadow as a parent element?

When you style your own jQuery theme here: http://jqueryui.com/themeroller/ you can see that the modal dialog box in the section "Overlay and Shadow Classes" has a shadow around it. 当您在此处设置自己的jQuery主题的样式时: http : //jqueryui.com/themeroller/您可以看到“叠加和阴影类”部分中的模式对话框周围有阴影。 In the source code it shows that the dialog is actually wrapped with another div that has the class ui-widget-shadow . 在源代码中,它显示了该对话框实际上是由另一个具有ui-widget-shadow类的div包装的。

For me this shadow is never visible because the dialog is not wrapped with this div when it is being created. 对我来说,这个阴影是永远看不见的,因为对话框在创建时没有被这个div包裹。 Does anybody know how to get jQuery dialog wrap the dialog in this element so the shadow is visible? 有谁知道如何获取jQuery对话框将对话框包装在此元素中,以便可见阴影?

On the declaration of the dialog you just need to specify that class. 在对话框的声明中,您只需要指定该类。

$(function () {
  $("#dialog").dialog({
    ...
    dialogClass: 'ui-widget-shadow'
  });
});

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

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