Solved

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

Posted on 2013-10-25
3
263 Views
Last Modified: 2013-10-25
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
Comment
Question by:patriotpacer
  • 2
3 Comments
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 39601017
Add  active: false

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

Open in new window

http://jsbin.com/uPIWoLe/2/
0
 

Author Closing Comment

by:patriotpacer
ID: 39601048
Thanks!
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39601217
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

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have answered several questions lately that were solved utilizing the power of jQuery's AJAX functions, so I thought I would write an article demonstrating the ease of use. Why should I use jQuery as opposed to regular JavaScript? Now I know…
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question