public
Description: MIT licensed code without warranty ; )
Homepage: http://www.debuggable.com/
Clone URL: git://github.com/felixge/debuggable-scraps.git
debuggable-scraps / jquery / expandable

jQuery Expandable Plugin

This plugin allows to add a expand / collapse link to elements with lots of text inside of them.

Usage / Docs

Allow long table columns to expand / collapse

$('table td').expandable();

Use custom link texts

$('table td').expandable({more: 'Show more ..', less: 'Show less'});

Set the cut-off length for the text to 42 characters (+ n characters until next whitespace is found)

$('table td').expandable({length: 42});

Set the cut-off length for the text to 42 characters (-n characters until previous whitespace is found)

$('table td').expandable({length: 42, greedy: false});

Missing Features

  • Handle elements containing html

Known Bugs

None