jQueryUI 可选择:无法将主题应用于所选项目(“ui-selected”类)
我正在使用 jQueryUI 开发一个应用程序。我也在使用Themeroller。我希望使用主题定义尽可能多的样式,这样如果我需要更改某些样式,我只需创建一个新的自定义主题(或下载现有主题)。
我正在尝试在 jQueryUI 中使用“可选择”交互。它正在正常工作 - 在 Firebug 中,我可以看到“ui-selected”类被应用于我选择的元素。但是,没有任何视觉提示表明该项目已被选择。我查看了主题 CSS 文件(jquery-ui-1.8rc3.custom.css,我从 Themeroller 页面< /a>),并且我没有看到“ui-selected”类的声明。当我下载 jQueryUI 和主题时,我检查了每个选项,包括“可选择”选项。
如何让我的主题定义“ui-selected”类?显然,我可以创建自己的样式声明,但如果我想更改主题,该解决方案并不理想。
我正在使用 jQuery 1.4.2 和 jQueryUI 1.8rc3。
I am developing an application using jQueryUI. I am also using the Themeroller. I want to have as many of my styles as possible defined using the theme, so that if I need to change some styles, I simply have to create a new custom theme (or download an existing theme).
I am trying to use the "selectable" interaction in jQueryUI. It is working as it should - in Firebug I can see the "ui-selected" class being applied to the element that I select. However, there is no visual cue that the item has been selected. I looked in the theme CSS file (jquery-ui-1.8rc3.custom.css, which I downloaded from the Themeroller page), and I see no declaration for the "ui-selected" class. When I downloaded jQueryUI and the theme, I checked every option, including the one for "selectable".
How can I make my theme define the "ui-selected" class? Obviously, I could just create my own style declaration, but that solution is not ideal if I ever want to change the theme.
I am using jQuery 1.4.2 and jQueryUI 1.8rc3.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以动态设置 ui 类,如下所示:
You can dynamically set the ui classes as this :
抱歉,答案很糟糕,但你不能。
这是 ThemeRoller 必须添加的功能,您无法自动添加到它生成的样式中。
如果您查看 演示页面,它们还会手动为
.ui 进行样式声明- 已选择
Sorry the answer sucks, but you can't.
This is functionality the ThemeRoller would have to have added, nothing you can do to add to it's generated styles automatically.
If you look at the demo pages, they also manually make the style declarations for
.ui-selected