Another post dedicated to Scriptaculous and to a nice way to implement Toggle effect.
This tutorial explains how to implement a simple Toggle effect using Scriptaculous framework. I prepared a simple tutorial you can download to see it in action:

Download this tutorialTo use scriptaculous effect on your pages you have to add this lines of code in the <head> tag:
<script language="javascript" src="scriptaculous/prototype.js"></script>
<script language="javascript" src="scriptaculous/scriptaculous.js"></script>
<script language="javascript" src="scriptaculous/scriptaculous.js"></script>
Then, you can apply Scriptaculous Toggle effect using this simple code, for example calling this function inside "onClick" attribute:
Effect.toggle('ID','type-of-effect'); return false
...where "ID" is the element you want to apply the toggle effect and "type-of-effect" is a toggle "sub-effect" (blind, appear, slide). I chose as toggle sub-effect "blink":
<h1 onclick="Effect.toggle('about-me','blind'); return false">About me</h1>
<div id="about-me">...some content...</div>
<div id="about-me">...some content...</div>
In this way you can apply this effect to every element using HTML "id" attribute.
Download this tutorial




Nice effect!
I am very lazy and don't always have the frameworks loaded.
Could you include a link to a sample page on your entries? I know you do this most of the time anyway.
I noticed is that I couldn't get the effect to return false with an onmousedown event. How come?
How can I set the panel property to closed by default? currently its open by default.
Nice effect btw.
waiting for your reply.
Regards,
Rakesh
Just change the enclosing div to < div style="display: none;"> and the panel will be hidden by default.
Thanks for posting the easiest way to toggle using scriptaculous effects already built in. Many people out there are trying to reinvent the wheel, writing extra scripts to do this.
Is there any standalone JS script that could do this one? I don't need any JS framework because this is the only effect I want.