Instance Settings

Customise each targetted paragraph with the settings below (all are optional):

$(selector).more({length: 60});

Note that the plugin expects the targetted paragraph to only contain text, and no other markup.

andNext | ellipsisText | ignoreTags | leeway | length | lessText | moreText | onChange | toggle | wordBreak

NameTypeDefaultComments
lengthnumber100 The number of characters shown after truncation.
leewaynumber5 The number of additonal characters allowed before truncation is actually applied. For example, with the default values, text up to 105 characters would not be truncated at all, while text over 105 characters would only show the first 100 followed by the ellipsisText and link.
wordBreakbooleanfalse When false the text is truncated at the character specified by length, regardless of its position within a word. When true the text is truncated at the first word boundary before length.
ignoreTagsstring[]['br', 'hr', 'img'] The list of tags that should be ignored during truncation processing since they don't require an ending tag.

Since 2.0.0
togglebooleantrue When true the link at the end of any truncated text toggles to allow the user to collapse the text again. When false the text can be expanded once but not collapsed again.
ellipsisTextstring'...' The text used at the end of a truncation to indicate that more text is available.
moreTextstring'Show more' The text shown on the link to expand the text.
lessTextstring'Show less' The text shown on the link to collapse the text.
andNextstring'' The selector for any following elements to be hidden along with the extra text in the original element. The selector is applied to jQuery's nextAll function.

Since 2.0.1
onChangefunctionnull A callback function to notify of expansion/collapse. The function receives one parameter being true if expanded or false if collapsed. Within the function this refers to the targetted paragraph.

$(selector).more({onChange: function(expanding) {
	$(this).effect('highlight', {color: expanding ? '#cfc' : '#fcc'});
}});
Functions

destroy | option (get) | option (set) | setDefaults

SignatureReturnsComments
$.more.setDefaults(settings)More object Update the default instance settings to use with all more text instances.
$(selector).more('option', options)jQuery object Update the settings for the more instance(s) attached to the given element(s).

options (object) the collection of new settings.

$(selector).more('option', {length: 200, toggle: false});

Since 1.1.0 - previously you used the 'change' command.
$(selector).more('option', name, value)jQuery object Update a particular setting for the more instance(s) attached to the given element(s).

name (string) the name of the setting to change;
value (any) the new value of that setting.

$(selector).more('option', 'length', 200);

Since 1.1.0.
$(selector).more('option', name)object or any Retrieve one or all of the current settings for the first more instance attached to the given element(s).

name (string, optional) the name of the setting to retrieve; omit for all settings.

var settings = $(selector).more('option');
var length = $(selector).more('option', 'length');

Since 1.1.0 - previously you used the 'settings' command.
$(selector).more('destroy')jQuery object Remove the more functionality from the given text.