Skip to content

Instantly share code, notes, and snippets.

@bryanjswift
Created August 16, 2008 19:25
Show Gist options
  • Save bryanjswift/5739 to your computer and use it in GitHub Desktop.
Save bryanjswift/5739 to your computer and use it in GitHub Desktop.
window.addEvent('domready', function() {
//create our Accordion instance
var myAccordion = new Accordion($('accordion'), 'a.toggler', 'div.element', {
start:'all-close',
alwaysHide: true,
opacity: true,
onActive: function(toggler, element){
toggler.setStyle('background-position', '0 -30px');
},
onBackground: function(toggler, element){
toggler.setStyle('background-position', '0 0');
}
});
// added an onComplete event which changes the height of the wrapping div created by Fx.Slide to auto
var myVerticalSlide = new Fx.Slide('vertical_slide',{
'onComplete': function() {
myVerticalSlide.wrapper.setStyle('height','auto');
}
}).hide();
$('v_toggle').addEvent('click', function(e){
e.stop();
myVerticalSlide.toggle();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment