JQuery 手风琴问题
我一直在我的网站上使用 http://jqueryui.com/themeroller/ ,它工作正常,但对于一件事。我想要为手风琴用户界面提供两种不同的布局/设计。我怎样才能做到这一点?
任何建议将不胜感激。
谢谢
I've been using http://jqueryui.com/themeroller/ for my site and it works fine but for one thing. I want to have a two different layout/design for the accordion UI. How can I accomplish this?
Any suggestion would be very much appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能不应该这样做,因为一组统一的小部件的目的是促进一致性。然而,我意识到这不是你的问题,你可能有理由。
“最简单”的方法是向“备用”手风琴添加特殊的 ID 或类。然后在你的 CSS 中你必须有更多的特殊性才能覆盖现有的。我个人会避免将其直接添加到您的 themeroller CSS 中;将其添加到网站 CSS 等其他位置,以便轻松维护 Themeroller 样式。
因此,如果 jQuery UI 自动应用类似的内容:
您需要更加具体,以便为您自己的规则提供更高的优先级:
我可以告诉您:这将是一个痛苦。 jQuery UI 添加了大量的类,每个类都有一些相对模块化的用途。覆盖所有这些以在不同的手风琴上启用另一种外观和感觉将需要一些工作。
You probably shouldn't, since the point of a unified set of widgets is to promote consistency. However, I realize that's not your question and you might have reasons.
The "easiest" way to do it is to add a special ID or class to your "alternate" accordion. Then in your CSS you are going to have to have more specificity in order to override the existing one. I would personally avoid adding it directly to your themeroller CSS; add it somewhere else like your site CSS so that Themeroller styles are easily maintained.
So, where jQuery UI automatically applies something like:
you would need to be more specific to give your own rules greater priority:
I can tell you this: it's going to be a pain. jQuery UI adds a tonne of classes, each with some relatively modular purpose. Overriding all of those to enable another look and feel on a different accordion is going to be some work.