Reputation: 11
I am using this code:
<script>
$(document).ready(function() {
$("#accordion").accordion(
active: false,
collapsible: true
});
</script>
But the accordion is broken and all panels are open.
How can I code it so the accordion panels area all closed.
Thanks to those who can help me.
Upvotes: 0
Views: 327
Reputation: 1171
$(document).ready(function () {
$("#accordion").accordion({
active:false,
collapsible:true
});
});
Upvotes: 0
Reputation: 2832
It looks like you are missing several braces and parenthesis. Try this:
<script>
$(document).ready(function() {
$("#accordion").accordion({ // <- add this curly brace {
active: false,
collapsible: true
});
}); // <- add these to close the ready function
</script>
P.S. I'm sure a javascript error was raised for this. To see these errors, open up your javascript console. In Chrome, hit F12 and click on Console. In Firefox, install firebug and then hit F12. In IE, well, don't debug there. (I'm half kidding; IE has a debugger that you can use if you want.)
Upvotes: 2
Reputation: 5371
Try this setting
alwaysOpen: false
oh and you got some missing braces there
$(document).ready(function() {
$("#accordion").accordion({
active: false,
collapsible: true,
alwaysOpen: false
});
});
Upvotes: 0
Reputation: 160943
Did you missed the {
?
$("#accordion").accordion({
active: false,
collapsible: true
});
Upvotes: 0
Reputation: 53361
You have a few typos in your question code. This should work:
$(document).ready(function() {
$("#accordion").accordion({
active: false,
collapsible: true
});
});
Upvotes: 1