CollapsibleFieldset 1.0 Documentation

Table of Contents


Introduction

CollapsibleFieldset is a simple JavaScript class which makes it very easy to create (what else?) collapsible fieldsets on your web pages.

It relies on the Scriptaculous library, which is awesome and free.


Demo

Click on the legend ("Hippo Information") to see exactly what this thing does.

Hippo Information
kg


Basic Usage

These instructions assume that you store your JavaScript files in a subdirectory named "js" in the root of your web directory. If this isn't the case, substitute the correct paths in the <script> tags below.

  1. Download the Scriptaculous library and unzip it into your JavaScript directory.

  2. Download CollapsibleFieldset and extract it into your JavaScript directory.

  3. Add the following code to the <head> of your HTML document:

    <script type="text/javascript" src="/js/scriptaculous-js-1.7.0/lib/prototype.js"></script>
    <script type="text/javascript" src="/js/scriptaculous-js-1.7.0/src/scriptaculous.js"></script>
    <script type="text/javascript" src="/js/CollapsibleFieldset/CollapsibleFieldset.js"></script>

    (If you're using a version of Scriptaculous other than 1.7.0, change the pathnames accordingly.)

  4. Assign a CSS class of "collapsible" to each fieldset that should be collapsible. For example:

    <fieldset class="collapsible">

That's it!


Browser Compatibility

CollapsibleFieldset is known to work in the following browsers:

If you've tested it in other browsers, please email me with your findings, and I'll add them here. Please specify the exact browser and operating system versions in question.


License

CollapsibleFieldset is made available under the Creative Commons Attribution-Share Alike 3.0 License.

In short, this means that you are free to use, distribute, and modify the code, for commercial or non-commercial purposes, provided that all derivative works are made available under the same license, and that the original attribution is left intact. Please read the license for complete details.


Credits & Additional Resources

CollapsibleFieldset was written by Travis Miller.

If you've used CollapsibleFieldset in a project, I'd like to know about it. If you have bug reports, ideas for improvements or new features, or general technical comments, I'd like to hear about that as well.

You can get the latest version of CollapsibleFieldset from http://abandonedbanana.com/web/js/.