• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 275
  • Last Modified:

JQuery UI - Accordion (Easy question...i hope)

http://jqueryui.com/accordion/

is there a way to have it collapsed 100% on the page load?  Right now, by default, it seems to keep one open.

Here's what I have now.

      <script>
          $(function () {
              $("#accordion").accordion({
                  heightStyle: "content",
                  collapsible: true
              });
          });
  </script>

Open in new window

0
patriotpacer
Asked:
patriotpacer
  • 2
1 Solution
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Add  active: false

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

Open in new window

http://jsbin.com/uPIWoLe/2/
0
 
patriotpacerAuthor Commented:
Thanks!
0
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Your welcome.  you are right, this should be easier but the jquery documentation is not always intuitive in my opinion at least when you are learning.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now