Effect.toggle

Effect.toggle allows for easily toggling elements with an animation.

 

Availability

 

script.aculo.us V1.5.0 and later.

 

Syntax

 

Effect.toggle(element, ['appear' | 'slide' | 'blind'], [options] );

 

Options

 

element can be either a string containing the id of the element, or a Java Script DOM element object.

 

The options parameter is used to give any additional customization parameters to the effect. There are general and effect-specific options. See the individual effects for more information.

 

Notes

 

Keep in mind, like individual Effects, you must include a second DIV element, wrapping the contents of the outer DIV. So, if you call new Effect.Slide Down?(‘x’), your element must look like this:

 

<div id="x"><div>contents</div></div>