I have ported over this from my old website, only as a reminder of what the internet looked like in 2008…
I have chosen to go with a very simple code snippit to begin what I hope will be a useful repository of original code snippits. Unless I note otherwise, you are welcome to use any code in my “Code Snippits” post category. I would greatly appreciate it if you let me know you where using the code. Without further delay, this code allows you to easily put areas (of the div type) on your site that can be collapsed and expanded by clicking on a heading. This manipulation is done using JavaScript. In my code below, I have used functions from the MooTools toolkit (a great toolkit to use if you do much JavaScript). So, the installation is pretty straight forward:
images/icon_add.png
and images/icon_remove.png
. You can also use your own icons (they should be 16x16 pixels).
(Visual content broken)
You can also get only the parts of MooTools you need (for this script Element and Element.Styles) and compress the package into a small file (helps for faster page loading), by using the utility here.
(Visual content broken)
TITLE OF DROPDOWN BOX
Looking back, we’re all glad that more modern CSS and JS styling came along…