mooReadAll 0.2.2

mooReadAll is a mootools plugin designed to truncate html contents preserving the right html structure and without truncate tags.
mooReadAll takes the dom elements passed, parses their content cutting it to a user defined number of words. The tag structure is preserved, and the tags left opened by the cut are automatically closed. As an option all or some tags may also be removed (i.e. remove images from content summary). Then it includes a "read all" link to show the whole content (in different and custom manners). The action to perform when clicking it is highly customizable: inplace, link, js callback and layer action types are provided, see documentation for more informations. In case of layer type a title may be provided using the html5 data- attributes, and the layer showing up (lightbox style) may be made draggable, resizable and text-resizable.

<div>This element is left as is</div>
<div class="readall" data-title="This title is shown in the layer window">
<p>This element is truncated after 12 words, and the <b>opened tag are automatically closed.</b>. A read all link appears. When clicking over it a draggable layer (lightbox style) appears with aldo two controls for text resizing. The layer width is 600px.</p><p>Please use css to control the layer height/max-height if needed.</p>
</div>
<div class="readall2">
<p>This element's content is <i>truncated</i> after 20 words, the <img src="path-to-an-image" />img tag is removed and the "read all" link which is "expand" causes the whole content to appear in the same element. Then a "back" link appears to compress another time the content. This is an example of how "local" options passed to the add method overwrites the global ones passed to the constructor (see documentation).</p>
</div>

For more demos please visit the mooReadAll demo page at http://www.abidibo.net/projects/js/mooReadAll/demo