
Ellipsis.js is a pure JavaScript library for responsive text truncation which enables you to truncate multi-line text within a specified DOM element(s) with ellipsis.
How to use it:
Link to the JavaScript file ‘ellipsis.js’:
<script src="ellipsis.js"></script>
Initialize the Ellipsis, specify the target container and set the maximum lines of text to show after truncating.
Ellipsis({
class: '.container',
lines: 3
});All default configuration options.
Ellipsis({
ellipsis: '…', // custom ellipsis character
debounce: 100, // chill out your memory usage on resizing
responsive: true,
class: '.clamp',
lines: 2,
portrait: null, // default no change, put a number of lines if you want a different number of lines in portrait mode
break_word: true // truncate words
});Changelog:
09/13/2018
- v0.1.3








for multiline truncations i recommend using the lightweight javascript plugin cuttr.js (https://www.npmjs.com/package/cuttr) for this. there are also options for word and sentence truncation.