jQuery - Horizontal Accordion

This jQuery plugin allows you to easily transform any unordered list into a horizontal menu.

Release:

Current: 2.0.0 Alpha (tested on jQuery 1.3+)

Product releases follow this format X.YY.ZZ (i.e. 1.0.2)

X signify a major version related to production release.

YY signify a minor version with feature changes or additions.

ZZ signify patches and bug fixes. Minor features that do not introduce backward compatibility issues are ok.

Follow me on Twitter for the latest updates: http://twitter.com/portalzine

Currrent functionality:

Planned additions

Tested on:

Browser
working
comment planned updates
Firefox 3
works fine  
IE 6
works with fixed width setting - other errors related to png images / css (add png fix) will work on that further down the road :)
IE 7
works fine  
Safari 3
works fine  
Opera
works with fixed width setting Seems to be a jQuery problem, as it sends back different width values on Opera. Looking into that.
Chrome
works fine  
Konqueror
not working  

Dependencies

The Markup:

Get raw code
Language: html
  1. <ul id="callMe">
  2. <li>Content 1</li>
  3. <li>Content 2</li>
  4. <li>Content 3</li>
  5. </ul>
© 2010 portalZINE

The CSS:

Get raw code

Language: css
  1. /* hide container until all is ready */
  2. .test, .test2,.test3,.test4{
  3. display: none;
  4. }
  5. /*Main Container*/
  6. .container {
  7. width:100%;
  8. }
  9. .container ul{
  10. list-style-type: none;
  11. margin: 0;
  12. padding:0;
  13. }
  14. .container li{
  15. display: inline;
  16. margin: 0px;
  17. padding:0px;
  18. }
  19. /*Content Container*/
  20. .contentContainer {
  21. padding-left: 0px;
  22. float: left;
  23. width:0px;
  24. height: 310px;
  25. overflow:hidden;
  26. }
  27. .contentWrapper{
  28. }
  29. .contentInnerWrapper{
  30. text-align: justify;
  31. padding: 10px;
  32. }
  33. /* Handle*/
  34. .handle{
  35. float: left;
  36. width: 38px;
  37. height: 310px;
  38. margin: 1px;
  39. margin-right: -10px;
  40. background: url(../images/blade.png) no-repeat;
  41. }
  42. .handleOver{
  43. background: url(../images/blade_sel.png) no-repeat;
  44. }
  45. .handleSelected{
  46. background: url(../images/blade_sel.png) no-repeat;
  47. }
  48.  
© 2010 portalZINE

Example calls & options:

Get raw code

Language: javascript
  1. $(document).ready(function() {
  2. $(".test").hrzAccordion(
  3. {eventTrigger:"mouseover",
  4. openOnLoad:"",
  5. cycle: true
  6. });
  7.  
  8. $(".test4").hrzAccordion(
  9. {eventTrigger: "mouseover",
  10. openOnLoad : "2",
  11. handlePositionArray : "left,left,right,right,right"
  12. });
  13.  
  14. $(".test2").hrzAccordion(
  15. {handlePosition : "right",
  16. openOnLoad : 5,
  17. closeOpenAnimation : 2
  18. });
  19.  
  20. $(".test3").hrzAccordion(
  21. {containerClass : "container3",
  22. listItemClass : "listItem3",
  23. contentWrapper : "contentWrapper3",
  24. contentInnerWrapper: "contentInnerWrapper3",
  25. handleClass : "handle3",
  26. handleClassOver : "handleOver3",
  27. handleClassSelected: "handleSelected3"
  28. });
  29.  
  30. });
© 2010 portalZINE

Documentation

The current plugin provides some simple options to alter its look and behavior.

Option Default
containerClass "container"
The div container wrapped around the whole list.
listItemClass "listItem"
Class assigned to each list item
contentContainerClass "contentContainer"
Class that defines the actual container for the content that will be animated
contentWrapper "contentWrapper"
A container wrapped around the content to apply special layout definitions
contentInnerWrapper "contentInnerWrapper"
Another inner container wrapped around the content
handleClass "handle"
Class that defines the look of the handle, this handles the open and close event for each blind
handleClassOver "handleOver"
Class that defines the mouse over event for the handle
handleClassSelected "handleSelected"
Class that defines the select status of the handle
handlePosition "left"
Position of the handle (left | right | bottom | top)
handlePositionArray "left,left,right,right,right"
Position each handle differently
closeEaseAction "swing"
The close easing animation
closeSpeed 500
The closing speed
openEaseAction "swing"
The open easing animation
openSpeed 500
The opening speed
openOnLoad 1
Define which container to show on page load. (false, 1, 2, 3, ....)
hashPrefix "tab"
Allows you to open containers using a hash tag in the url (index.html#tab1). This defines the prefix to be used.
eventAction function(){}
Function to be executed on click
completeAction function(){}
Function to be executed on completion of the switch
closeOpenAnimation 1
1 - open and close at the same time
2- close all and than open next
cycle false
Cycle through containers by interval
cycleInterval 10000
Cycle interval in milliseconds (10000 = 10 seconds)
fixedWidth ""
Use fixed width for containers. Normally the plugin calculates the width from the main container.
eventWaitForAnim true
Makes sure to allow no new event to be triggered, until animation has ended
   

History & Download


 Downloads
Type Name Date Hits Download

jQuery_Horizontal... Apr 18, 2009 42018
Description: 2.00.00 Alpha

Comments



©2009 portalZINE®



Author: A.Graef | Revision: 1.0 | Last updated: 25.11.07 - 19:58 | Created: 25.10.07 - 20:58