- 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.
To collapse to a length:
$(".bio").readmoreless(); $(".bio").readmoreless({ substr: true, substr_len: 500, ellipses: '…', more_link: '<a class="more">Read More</a>', less_link: '<a class="less">Read Less</a>' });
To collapse to a selector:
$(".bio").readmoreless({ substr: false }); $(".bio").readmoreless({ substr: false, less_selector: ":first", ellipses: '…', more_link: '<a class="more">Read More</a>', less_link: '<a class="less">Read Less</a>' })
jQUery.readmoreless is covered by the MIT License.