我想从我的JQuery UI Accordion中删除特定组中的图标,但这些图标似乎在JS中以非常困难的方式设置。
我认为在我的Jquery函数中使用"icons : false"
会关闭手风琴中所有组的图标,但我想将它们关闭仅用于特定的(在这种情况下,最后一组称为&# 34;单节"),可能吗?
$(function() {
$( "#accordion" )
.accordion({
header: "> div > h3",
icons: false
})
.sortable({
axis: "y",
handle: "h3",
stop: function( event, ui ) {
// IE doesn't register the blur when sorting
// so trigger focusout handlers to remove .ui-state-focus
ui.item.children( "h3" ).triggerHandler( "focusout" );
// Refresh accordion to handle new order
$( this ).accordion( "refresh" );
}
});
});
以下是完整代码的jsfiddle。
答案 0 :(得分:1)
你可以通过CSS
来做到这一点<div class="DivContains">
<img src="http://image.jpg">
</div>
.DivContains{
width: 50px;
height: 50px;
}
img{
height: 100%;
width: 100%;
}
您可以为单个手风琴组添加一个类并通过CSS
进行控制答案 1 :(得分:0)
您也可以通过jquery
来完成$(“#accordion”)。find('。device .ui-accordion-header-icon')。hide();