jquery-abbreviate

Abbreviates a jQuery collection, hiding or showing n elements.  Provides a DOM element that, when clicked, will reveal the abbreviated elements.

Parameters

nIf positive, indicates the number of items shown.  If negative, the number hidden.  (required)
optionsPlugin options (all optional).
options.textThe innerText of the returned link.  {#} is replaced with the number of hidden elements.

Returns

jQuery <a> element that, when clicked, will reveal the abbreviated elements.  Needs to be inserted into the DOM.  If the number of the items in the collection is fewer than n, returns an empty jQuery collection

Example

var $list = $('#items');
$list.children('li').abbreviate(3).insertAfter($list);

Author

Chuck Harmston: ch.nosp@m.uck@chuckhar.nosp@m.mston.com

Version

0.1

Close