I am using jQuery accordion. I want to set accordion as expanded or collapsed dinamically.
For this I wrote this:
<script type="text/javascript">
$(function() {
$( "#_title_${sec_id}_id" ).accordion({
active: ${open},
collapsible: true,
heightStyle: "content"
});
});
</script>
But if ${open}
is true accordions are collapsed , and if ${open}
is false they are collapsed again .
Is this a bug Or I am mistaken somewhere?
Is there a solution?
As per accordion api active is meant for "Which panel is currently open." , it takes false (to collapse all) or other options are numeric like 1, 2 to active either the first or second respectively
Logically it will not be a bug because as accordion is meant to collapse the menu. You can post to their forum for better clarification
I tried using active: false/true
but they both behave the same. http://jsfiddle.net/raunakkathuria/sc7uL/1/
See this blog for explanation regarding this http://forum.jquery.com/topic/expand-all-zones-for-an-accordion
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.