a jQuery plugin for deep-HTML truncation and toggling
- Server-side text truncation based on character counts is always incorrect. The width of the character string "iiiii" is approximately 58% less than the width of "MMMMM" unless a monospace font is used.
- The CSS3 property "text-overflow" can only truncate a single line of text, and is not supported by IE7 and below.
- HTML truncation to a specified number of lines, including HTML that wraps around other floated elements.
- Deep-HTML truncation with preservation of all non-type3 (text) nodes
- Optional specification of a truncation suffix, e.g. …
- Toggling between truncated and un-truncated states with configurable hyperlink text
- Triggered events when the truncated state of the HTML is changed
- O(log n) execution time for n := text length
- Pre-truncation and re-truncation analyses are both performed on cloned elements to minimize DOM flicker
- Optional console logging of execution time and number of steps for performance analysis
- Ability to merge modifications to truncated HTML back into the original HTML