[英]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" });
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.