user1512286
user1512286

Reputation: 11

Accordion is broken

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

Answers (5)

Scorpio
Scorpio

Reputation: 1171

$(document).ready(function () {
  $("#accordion").accordion({
    active:false,
    collapsible:true
  }); 
});

Upvotes: 0

lbstr
lbstr

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

fedmich
fedmich

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

xdazz
xdazz

Reputation: 160943

Did you missed the {?

$("#accordion").accordion({
    active: false,
    collapsible: true            
});

Upvotes: 0

Elliot Bonneville
Elliot Bonneville

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

Related Questions