logo
  • 4
    • 4 New Messages
    • icon
      Riot Zeast
      Hello, You there?
      8 minutes ago
    • icon
      John Kerry
      Can we Meet ?
      45 minutes ago
    • icon
      Jenny Kerry
      Dont forgot to call...
      An hour ago
    • icon
      Ronny
      Hey! sup Dude?
      3 Hours ago
    • View all
  • 7
    • You have 7 notifications
      • after a long time Just Now
      • Jef's Birthday today Few seconds ago
      • out of space 8 minutes ago
      • New friend request An hour ago
      • On sale 2 products 3 Hours ago
      • Lee Shared your photo Yesterday
      • David liked your photo 2 July 2014
    • View all
  • riot
    Riot
    • User Image

      Riot Zeast

    • My Profile
    • Account Settings
    • Lock
      Logout
  • Dashboard
  • Builders
    • Form Builder
    • Form Builder 2
    • Button Builder
    • Page Builder
  • Forms
    • Form Examples
    • Form Editors
    • Form Editors 2
    • Form Validation
    • Form Elements
    • Drop Downs
    • Radio and Checkbox
    • Ratings
    • Form Layouts
    • Form Wizards
    • Accordion Wizards
    • Date Pickers
    • Advanced Date Pickers
  • UI Features
    • Animated Icons
    • Buttons
    • Advanced Buttons
    • Tabs and Accordions
    • Panels
    • Font Icons
    • Color Picker Slider
    • Grid Layout
    • Carousel
    • Advanced Modals
    • Tags Input
    • Advanced Modals
    • Tags Input
    • Nestable List
    • Sortable List
    • Treeview and jsTree
    • Toastr Notifications
    • Sweet Alert
    • Notifications
    • Session Timeout
    • Draggable Portlets
  • UI Components
    • General Components
    • Pickers
    • X-editable
    • Timeline
    • Transitions
    • Sliders
    • Circles Sliders
  • Data Tables
    • Simple tables
    • Advanced Data Tables
    • Advanced Data Tables 2
    • Editable Data Tables
    • Responsive Data Tables
  • Charts
    • Flot Charts
    • Pie Charts
    • Animated Charts
    • JS Charts
    • Sparkline Charts
  • 7 Calendar
  • Email
    • Inbox
    • Compose
    • Single Mail
  • 10 Tasks
  • Gallery
    • Gallery
    • Masonry Gallery
    • Dropzone
    • Image Cropping
    • Multiple File Upload
    • Image Magnifier
  • Users
    • Users List
    • Add New User
    • View Profile
    • Deleted Users
  • Maps
    • Google Maps
    • Vector Maps
    • Advanced Maps
  • Blog
    • Blog Category List
    • Blog List
    • Add New Blog
  • News
    • News
    • News Details
  • Pages
    • Lockscreen
    • Invoice
    • Login
    • Login 2
    • Register
    • Register 2
    • 404 Error
    • 500 Error
    • Blank Page

Accordion Wizards

  1. Dashboard
  2. Forms
  3. Accordion Wizards

Specials

Follow the steps below to add an accordion wizard to your web page.

  1. Prerequisites
  2. Add Wizard
  3. Adjust HTML
  4. Release

Install Bootstrap

The accordion wizard depends on two other open source packages:

  • The Bootstrap framework, available here .
  • The jQuery javascript library, available here .
Note that Bootstrap itself depends on jQuery for its interactive components, so if you're using Bootstrap you probably already have jQuery as well.

You'll include the CSS styles for Bootstrap in the <head> of your HTML file, for example:

<link href="css/bootstrap.min.css" rel="stylesheet">

and you'll include jQuery and Bootstrap javascript files at the end of your <body> section, for example:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" type="text/javascript"></script>
                                                        <script src="js/bootstrap.min.js"></script>

Accordion Wizard

If you haven't already found it, the source code for the accordion wizard is available on github here . There are two main folders, /src and /release .

There are two different ways to add the accordion wizard to your pages. The simplest approach is just to add the CSS and javascript files from the /release folder directly in your HTML without modifying them:

<link href="css/bootstrap.min.css" rel="stylesheet">
                                                            <link href="css/acc-wizard.min.css" rel="stylesheet">
                                                        

and

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" type="text/javascript"></script>
                                                            <script src="js/bootstrap.min.js"></script>
                                                            <script src="js/acc-wizard.min.js"></script>
                                                        

The release styles for the accordion wizard are based on Bootstrap's default styles. If you've tweaked the Bootstrap styles (e.g. by changing the link color), you'll want to make corresponding tweaks to acc-wizard.min.css .

Alternatively, if you're building custom CSS and javascript, then you might want to start with the files in the /src folder and adapt them to your source code. The /src folder contains a LESS file and uncompressed (and commented) javascript. Note that the acc-wizard.less file depends on variables defined in Bootstrap's variables.less file.

Adjust HTML Markup

Now you can modify your HTML markup to activate the accordion wizard. There are two parts to the markup—the collapsible accordion itself and the task list. I prefer putting both in the same .row with the task list taking up a .col-md-3 and the accordion panels in a .col-md-9 , but that's not a requirement.

The accordion panel can be exactly as documented in the Bootstrap example , but I think there's a problem with the Bootstrap implementation. Specifically, the Bootstrap example only adds the class .in to one of the accordion panels. That class marks the panel as visible by default. The problem with only having one panel visible by default is that users without javascript will never be able to see the other panels. Sure, that's a minority of users, but why make your pages unworkable even for a small minority. Instead, I suggest adding .in to all your .collapse elements and have javascript code select only one to make visible when it runs. The accordion wizard javascript will handle that for you if you choose to use that approach.

The sidebar task list is nothing but a standard HTML ordered list. The only required additions are adding the .acc-wizard-sidebar class to the <ol> element and .acc-wizard-todo to the individual list items. If you want to indicate that some steps are already complete, you can instead add the .acc-wizard-completed class to the corresponding <li> elements.

<ol class="acc-wizard-sidebar">
                                                              <li class="acc-wizard-todo"><a href="#prerequisites">Install Bootstrap and jQuery</a></li>
                                                              <li class="acc-wizard-todo"><a href="#addwizard">Add Accordion Wizard</a></li>
                                                              <li class="acc-wizard-todo"><a href="#adjusthtml">Adjust Your HTML Markup</a></li>
                                                              <li class="acc-wizard-todo"><a href="#viewpage">Test Your Page</a></li>
                                                                </ol>
                                                        

Finally, you'll want to active the wizard in your javascript. That's nothing more than simply calling the plugin on an appropriate selection.

<script>
                                                            $(window).load(function() {
                                                                $(".acc-wizard").accwizard();
                                                            });
                                                            </script>
                                                        

The default options are probably fine for most uses, but there are many customizations you can use when you activate the wizard. Check out the documentation on github for the details.

Test Your Page

Naturally, the last thing you'll want to do is test your page with the accordion wizard. Once you've confirmed that it's working as expected, release it on the world. Your users will definitely appreciate the feedback and guidance it gives to multi-step and complex tasks on your web site.