jQuery手风琴问题

时间:2012-10-23 07:49:05

标签: javascript

我已按以下方式初步化手风琴。

<script>
$(function()
    $( "#accordion" ).accordion({
    autoHeight:false});
});
</script>

一切正常,但下面的内容在展开包含比第一个更高的部分时不会向下移动。

现场观看的网址是http://thephpcode.com/index.php/web/setting_issue

尝试扩展最后一部分并看到手风琴下方的按钮不向下移动。它出现在手风琴显示屏的顶部。如何解决这个问题?

2 个答案:

答案 0 :(得分:0)

解决方案是:

$( "#accordion" ).accordion({
heightStyle: "content"
});

答案 1 :(得分:0)

您也可以尝试插件http://accordion-cd.blogspot.com/

如果您希望默认选择特定项目。 还有许多选项可用于定制您的需求。

传入插件的参数:

heading  :  null  //mandatory to provide Heading tag to attach event
content  :  null  //mandatory to provide Content to show/hide
headingEvent  : "click"   //Attach Event
active : 0   //By default visible element
callapsAll  :  false   //to hide all on page load
expandAll  :  "expandAll"   //Element name on Expand All Functionality attached
collapsAll  :   "collapsAll"   //Element name on Collapse All Functionality attached
headingClass  :  "accordion-header"   //Accordion Heading Class
contentClass  :  "accordion-content"   //Accordion Content Class