Cuttr.js is a JavaScript library for generating multi-lined ellipsed text. Indicating the character, word or sentence length, it will truncate the text at the correct position in targeted elements. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.
Cuttr.js is a JavaScript library for generating multi-lined ellipsed text. Indicating the character, word or sentence length, it will truncate the text at the correct position in targeted elements. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.
Cuttr is a vanilla Javascript plugin with which multiple-line texts on a website can be cut. At the end of the text to be truncated, defined characters such as an ellipse are added to indicate that there is more content than currently visible. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
// truncate after 100 characters by default
new Cuttr('.example-basic');
Cuttr is also a jQuery plugin with which multiple-line content on a website can be cut off. At the end of the text to be truncated, defined characters such as an ellipse are added to indicate that there is more content than currently visible. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
// truncate after 100 characters by default
$('.example-basic-jquery').Cuttr();
With the cuttr.js javascript library, js truncation with words is made simple. At the end of the text to be truncated, defined characters such as these dots are added to indicate that there is more content than currently visible. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
new Cuttr('.example-words', {
//options here
truncate: 'words',
length: 25
});
With the cuttr jQuery library, js truncation with words is made simple. Does the HTML break on truncation? No! The markup will be kept and if full content is shown, the original content will be reverted. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
new Cuttr('.example-sentences', {
//options here
truncate: 'sentences',
length: 4
});
new Cuttr('.truncate-keep-html', {
//options here
truncate: 'words',
length: 15,
title: true,
readMore: true
});
Sometimes you want to add a custom ellipsis string to the truncated text content. It's also possible to add a read-more button to fold out and fold in the truncated content. This read more button has multiple customization options. All of this can be done pretty easy with the cuttr.js library.
new Cuttr('.example-ellipsis-read-more', {
//options here
truncate: 'characters',
length: 150,
readMore: true,
readMoreText: 'Show content',
readLessText: 'Hide content',
readMoreBtnPosition: 'after',
ending: ' ..►'
});
Explore the cuttr.js docs or buy the license that fits your needs