Jquery ui jqueryui手风琴子div大小
我有一个手风琴在我的网页上,和儿童div有不同长度的内容在他们。当手风琴显示时,第一个折叠只有一行文本,但div占用的空间与最长div相同。有没有办法让儿童div在展开时只占用所需的空间Jquery ui jqueryui手风琴子div大小,jquery-ui,accordion,Jquery Ui,Accordion,我有一个手风琴在我的网页上,和儿童div有不同长度的内容在他们。当手风琴显示时,第一个折叠只有一行文本,但div占用的空间与最长div相同。有没有办法让儿童div在展开时只占用所需的空间 如果这太模糊,我可以发布一些代码来解释我的意思。感谢您的帮助。如果您想让手风琴动态调整到其包含内容的高度,可以实现以下代码: $( "#accordion" ).accordion( "option", "autoHeight", false ); // or true if you want to chang
如果这太模糊,我可以发布一些代码来解释我的意思。感谢您的帮助。如果您想让手风琴动态调整到其包含内容的高度,可以实现以下代码:
$( "#accordion" ).accordion( "option", "autoHeight", false ); // or true if you want to change back
或使用高度样式:
控制手风琴和每个面板的高度。可能值:
"auto" // All panels will be set to the height of the tallest panel.
"fill" //Expand to the available height based on the accordion's parent height.
"content" //Each panel will be only as tall as its content.
代码示例:
使用指定的heightStyle选项初始化accordion:
$( ".selector" ).accordion({ heightStyle: "fill" });
如果希望手风琴动态调整大小,使其达到所包含内容的高度,可以实现以下代码:
$( "#accordion" ).accordion( "option", "autoHeight", false ); // or true if you want to change back
或使用高度样式:
控制手风琴和每个面板的高度。可能值:
"auto" // All panels will be set to the height of the tallest panel.
"fill" //Expand to the available height based on the accordion's parent height.
"content" //Each panel will be only as tall as its content.
代码示例:
使用指定的heightStyle选项初始化accordion:
$( ".selector" ).accordion({ heightStyle: "fill" });
你能给我们看看你的代码,可能是一个JSFIDLE吗?你能给我们看看你的代码,可能是一个JSFIDLE吗?heightStyle:“content”正是我想要的。谢谢。
$('#accordion')。accordion({autoHeight:false})代码>更适合我。heightStyle:“内容”正是我想要的。谢谢。$('#accordion')。accordion({autoHeight:false})代码>对我更有效。