简体   繁体   English

如何让jQueryUI的'对话'小部件使用`ui-state-error`样式?

[英]How do I get jQueryUI's 'dialog' widget to use the `ui-state-error` styles?

I'm using one of the standard themes (redmond) provided on the jQuery UI website. 我正在使用jQuery UI网站上提供的标准主题之一(redmond)。

I noticed that it ships with an icon png file with red icons as well as the blue coloured ones. 我注意到它附带了带有红色图标和蓝色图标的png文件。 I need to display a warning dialog box but make it use the red icons instead. 我需要显示一个警告对话框,但改为使用红色图标。

I notice in the theme's stylesheet there's a section called "Interaction Cues". 我注意到在主题的样式表中有一个名为“Interaction Cues”的部分。 Do I just set my dialogClass to ui-state-error which seems to have the desired effect, is this the correct way to do this? 我只是将dialogClass设置为ui-state-error ,这似乎有所需的效果,这是正确的方法吗?

I tried setting dialogClass: "error" but that had no effect. 我尝试设置dialogClass: "error"但是没有效果。

Yep you have it right, you need the full class name: 是的,您没错,您需要完整的类名:

$("div").dialog({ dialogClass: "ui-state-error" });

You can test it out here . 您可以在这里进行测试

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

相关问题 使用jQueryUI Dialog,我如何获得打开对话框的元素? - Using jQueryUI Dialog, how can I get the element that opened the dialog? 当长时间在主线程中执行某些操作时,如何让jQueryUI显示对话框? - How do I get jQueryUI to display a dialog when something long running is executing in the main thread? 如何在jQuery UI对话框窗口中添加额外的对话框小部件关闭按钮 - how do I add an extra Dialog Widget close button to a jquery ui Dialog window 如何使用 jqueryui 对话框按钮提交表单, - How do i submit a form with jqueryui dialog button, 如何在小部件中使用jquery-ui复选框? - How do I use jquery-ui checkbox within widget? JqueryUI,多个ID和其他关于droppable的语句,如何使它们工作? - JqueryUI, multiple ID's and else if statements on droppable, how do I get them to work? jQuery对话框-如何获取.ui-widget-shadow作为父元素? - jQuery dialog - how to get .ui-widget-shadow as a parent element? 如何使用jQuery / UI的Dialog阻止对话(“打开”)调用 - How do I block a dialog(“open”) call with jQuery/UI's Dialog 如何使用我的 state 渲染 UI 并做出反应 - How do I get the UI to render with my state with react 如何在网站上将Winjs 4.4.0用作jQueryUI或其他UI框架 - how can I use winjs 4.4.0 in the web site as jQueryUI or other UI framework
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM