jQuery UI Accordion - 如何完全删除样式?
我喜欢 jQuery 手风琴 (http://jqueryui.com/demos/accordion/) 的功能,但是我不想要这种风格!
我想摆脱所有的样式,img,边框,颜色等......
我没有看到这个选项,这是他们应该添加的东西。还是我误会了?
I love the functionality of the jQuery accordion (http://jqueryui.com/demos/accordion/) however I do not want the style !!
I'd like to get rid of all the styles, the img, the border, the color, etc...
I don't see an option for this, this is something they should add. Or I am mistaking?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
您可以制作自己的手风琴。在没有 UI 的情况下使用 jQuery 手风琴是没有意义的。创建适合您网站的您自己的手风琴很容易。您只需要修复您想要的构建方式...比方说:
然后,您只需要制作类似的内容
您现在可以根据需要编辑您的类,因为您实际上不需要它们用于 JavaScript。
请注意,类“content”中的 可以包含您想要的任何内容,包括 、 other 或 因为 .siblings 和 .next 仅适用于同一层次结构。
You can make your own accordion. Using the jQuery accordion without the UI is pointless. Creating your own accordion adapted to your site is kind of easy. You just need to fix the way you want to build it...let's say:
Then, you just need to make something like
You can now edit your class as you want since you actually don't need them for the JavaScript.
Note that the with the class 'content' can contain whatever you want, including , other or since the .siblings and .next only apply to the same hierarchy.
如果你对 ui 主题不感兴趣(像我一样),那么不要包含主题 css 文件
If your'e not interested in the ui-theme (like me) then don't include the theme css files
我需要(想要)做同样的事情。就我而言,我想删除默认 css 为手风琴内容提供的额外填充,如下所示:
在 MY css 中,我只是添加了以下内容:
这成功设置(覆盖)了填充。
抢
I needed (wanted) to do the same thing. In my case I wanted to remove the extra padding the default css provides for accordion-content, which looks like this:
In MY css I simply added this:
This successfully set (overrode) just the padding.
Rob
我猜你自从2010年写信以来就已经解决了这个问题。
顺便说一句,现在可以在下载主题之前在官方 jqueryUI 网站中通过控制面板避免每个 ui 小部件的样式。
http://jqueryui.com/themeroller/
如果是手风琴,只需“取消选中”复选框按钮“手风琴” '并下载生成的文件。
我知道回答已经很晚了,但我认为它可能有用......以防万一:)
I guess you have already solved the problem since you wrote in 2010.
By the way, now it's possible to avoid styling of each ui widget by control panel, in the official jqueryUI website, before download the theme.
http://jqueryui.com/themeroller/
In case of Accordion, just 'uncheck' the checkbox button 'Accordion' and download the generated file.
It's quite late to answer I know but I think it could be useful... just in case :)
你通常不会通过 js 来做到这一点,这就是为什么没有选择。你重写了CSS。查看基本 css 文件 并搜索
.ui-accordian
.. 还会有一些样式作用于您需要覆盖的一些通用.ui-widget
类。我通常将其加载到 Firebug 中并查看正在应用的内容,这样我就知道需要重写的所有内容才能赋予它我的外观和感觉。You dont generally do this via js thats why ther eis no option. You override the css. Check out the base css file and search for
.ui-accordian
.. there will also be styles scoped to some geenral.ui-widget
classes you need to override. I usually load it up in Firebug and take a look at whats being applied so i know everything i need to overried to give it my look and feel.忘记所有这些技巧、覆盖或其他痛苦。
下载主题时,您只需提供 css 范围,例如:
.jquerythemeon
然后将该类放入您想要主题化的所有元素
编辑:
我今天遇到了一些范围错误,在 Structure.min.css 中,范围始终是使用“jquerythemeon”而不是“.jquerythemeon”生成的。要修复它只需替换所有出现的情况
Forget all theese tricks, overrides or other pains.
You just have to provide a css scope when you donwload your theme, like:
.jquerythemeon
and then put the class to all elements you want to be themed
EDIT:
I got some bugs with scope today, in structure.min.css the scope was always generated with "jquerythemeon" and not ".jquerythemeon". To fix it just replace all occurences
要删除默认样式,请使用clearStyle选项:
To remove default style use clearStyle option: