Jquery 手风琴小部件 - 删除图标和填充
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3172602/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Jquery Accordion widget - remove the icon and padding
提问by liorix
I'm new to jquery and i'm trying to find out if it's possible to create simple accordion without the arrow icon and without padding at all inside the accordion content.
我是 jquery 的新手,我想知道是否可以创建简单的手风琴而没有箭头图标并且在手风琴内容中根本没有填充。
I want to use the whole content space, and it seems like jquery accordion widget auto create some padding as the width of the arrow icon.
我想使用整个内容空间,似乎 jquery 手风琴小部件会自动创建一些填充作为箭头图标的宽度。
Thanks! Lior
谢谢!利奥尔
回答by Renato Gama
to remove the icons you better use
删除您更喜欢使用的图标
$( "#accordion" ).accordion({
icons: false
});
回答by Mottie
All you need to do is add your own CSS to remove the icon and padding, or override the default CSS with something like this:
您需要做的就是添加您自己的 CSS 以删除图标和填充,或者使用以下内容覆盖默认 CSS:
#accordion .ui-icon { display: none; }
#accordion .ui-accordion-header a { padding-left: 0; }
if accordion
was the ID you where you called the function (see the demo)
如果accordion
是您调用该函数的 ID(请参阅演示)
Oh and if you want to remove the content padding, use this CSS:
哦,如果您想删除内容填充,请使用此 CSS:
#accordion .ui-accordion-content { padding: 0; }
回答by Anish
$("#accordion").accordion({
icons: null
});
worked for me
为我工作