Solved

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

Posted on 2013-10-25
3
260 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now