MOOTOOLS ACCORDION
Hacked version of accordion.js javascript:
- Can specify which elements you want open as an option. Option must be array of elements index.
example: You want elements 1, 2, and 3 opened on start, but not 4, and 5.
You would add an option like this 'itemsOpen: [0,1,2]'
- Can now specify action of toggling each accordion element, without closing the others. Just like the option states, it opens and closes.
Add an option 'openClose: true'
Bonus javascript code that toggle the accordions based on a pressed key combo. In this example, pressing 'Control + 1' key combo will toggle accordion 1. This was done through key 5. If you want to do this for other keys, you'll have to modify the function to handle the keyCode.
Javascript code to toggle pill image depending on which accordion you just toggled works mostly. Its a little buggy.
Back to examples list
Toggle Section One
Hi there! This is some variable length content for the javascript mootools accordion.
END.
Toggle Section Two
More variable length content
END.
Toggle Secion Three
More variable length content
END.
Toggle Section Four
This one is not in the open first array. More variable Content.
END.
Toggle Section Five
This one is not in the open first array. More variable Content.
END.