- Overview
- Documents
liteAccordion - a horizontal accordion plugin for jQuery
A combination of an image slider and an accordion, the Slidorion displays beautiful images along with a variable length description. With slides linked to each tab, and accompanied by a large array of effects, the Slidorion is a great alternative to the traditional jQuery slider
Basic Implementation
1. Include jQuery, the liteAccordion CSS and the liteAccordion JavaScript files in your page:
<head> <link rel="stylesheet" href="liteAccordion.css"> </head> <body> ... <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script src="liteaccordion.jquery.js"></script> </body>
2. Insert the basic liteAccordion markup into your page:
<div> <ol> <li> <h2><span>Slide One</span></h2> <div></div> </li> <li> <h2><span>Slide Two</span></h2> <div></div> </li> <li> <h2><span>Slide Three</span></h2> <div></div> </li> <li> <h2><span>Slide Four</span></h2> <div></div> </li> <li> <h2><span>Slide Five</span></h2> <div></div> </li> </ol> <noscript> <p>Please enable JavaScript to get the full experience.</p> </noscript> </div>
3. Call the plugin
<script> $('#yourdiv').liteAccordion(); </script>
Options
These are the default settings for the liteAccordion plugin:
containerWidth : 960, // fixed (px) containerHeight : 320, // fixed (px) headerWidth: 48, // fixed (px) activateOn : 'click', // click or mouseover firstSlide : 1, // displays slide (n) on page load slideSpeed : 800, // slide animation speed onTriggerSlide : function() {}, // callback on slide activate onSlideAnimComplete : function() {}, // callback on slide anim complete autoPlay : false, // automatically cycle through slides pauseOnHover : false, // pause on hover cycleSpeed : 6000, // time between slide cycles easing : 'swing', // custom easing function theme : 'basic', // basic, dark, light, colorful, or stitch rounded : false, // square or rounded corners enumerateSlides : false, // put numbers on slides linkable : false // link slides via hash
Simply pass options into the liteAccordion function with an object literal, for example, below is the code for the accordion at the top of the page.
$('#one').liteAccordion({ onTriggerSlide : function() { this.find('figcaption').fadeOut(); }, onSlideAnimComplete : function() { this.find('figcaption').fadeIn(); }, autoPlay : true, pauseOnHover : true, theme : 'stitch', rounded : true, enumerateSlides : true }).find('figcaption:first').show();
Methods
These are the methods for the liteAccordion plugin:
play // trigger autoPlay on a stopped accordion stop // stop an accordion playing next // trigger the next slide prev // trigger the previous slide destroy // remove the accordion, destroying all event handlers and styles debug // returns a debug object
All of these methods are chainable (i.e. they return the original DOM object) with the exception of the debug method. To call a method, use:
$('#yourdiv').liteAccordion('play');
To chain methods:
$('#yourdiv').liteAccordion('next').liteAccordion('next');