felixge / debuggable-scraps

MIT licensed code without warranty ; )

This URL has Read+Write access

commit  28f4cb7252e75406732f7024f947d96bae440fcf
tree    9d829c29cec194a3d9bf543af71979487a710e88
parent  2fa42a95d10b9fefb76ca393599570d6927ea115
debuggable-scraps / jquery / expandable
name age message
..
file jquery.expandable.js Loading commit data...
file readme.textile
jquery/expandable/readme.textile

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