Simple Threaded Comments with jCollapsible (JQuery Plugin)

This JQuery plugin allows you to create collapsible lists quickly and easily, which is especially useful for threaded (nested) comments or forum posts.

Examples:

  1. Parent Object 1
    • Child Object 1
    • Child Object 2
  2. Childless Object
  3. Parent Object 2
    • Child/Parent 1
      • Grandchild 1
      • Grandchild 2
    • Child Object 2





Usage and Options

$('#mylist').collapsible();

There are several customizable options, including:

  1. defaulthide - hide all children by default (default: true)
  2. symbolhide - symbol to hide child elements (default: -)
  3. symbolshow - symbol to show child elements (default: +)
  4. imagehide - image to hide child elements (default: null)
  5. imageshow - image to show child elements (default: null)
  6. xoffset - amount pixels to move symbol/image horizontally (default: -15)
  7. yoffset - amount pixels to move symbol/image vertically (default: 0)

License

This plugin is released under the GPL, MIT, BSD and anything else that makes it absolutely free to do whatever you want with it. If you like, you can link back to the original article or the blog itself, DevGrow (it's appreciated but definitely optional).