开发者

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

开发者 https://www.devze.com 2023-01-31 09:32 出处:网络
I\'m using one of the standard themes (redmond) provided on the jQuery UI website. I noticed that it ships with an icon png file with red icons as well as the blue col开发者_开发技巧oured ones. I nee

I'm using one of the standard themes (redmond) provided on the jQuery UI website.

I noticed that it ships with an icon png file with red icons as well as the blue col开发者_开发技巧oured ones. 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". 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?

I tried setting dialogClass: "error" but that had no effect.


Yep you have it right, you need the full class name:

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

You can test it out here.

0

精彩评论

暂无评论...
验证码 换一张
取 消