/jQuery.readmoreless

jQuery plugin to substring long paragraphs and make expandable with "more" and "less" links.

jQuery.readmoreless

author

Arwid Bancewicz arwid.ca

version

0.1

updated

23 Feb 2011

Minimize long paragraphs and make expandable with “more” and “less” links. Either collapse to a length or a selector.

Usage

To collapse to a length:

$(".bio").readmoreless();

$(".bio").readmoreless({
  substr: true,
  substr_len: 500,
  ellipses: '…',
  more_link: '<a class="more">Read&nbsp;More</a>',
  less_link: '<a class="less">Read&nbsp;Less</a>'
});

To collapse to a selector:

$(".bio").readmoreless({
  substr: false
});

$(".bio").readmoreless({
  substr: false,
  less_selector: ":first",
  ellipses: '&#8230;',
  more_link: '<a class="more">Read&nbsp;More</a>',
  less_link: '<a class="less">Read&nbsp;Less</a>'
})

License

jQUery.readmoreless is covered by the MIT License.