Support multiple lines ellipsis
http://plugins.jquery.com/ellipsis/
Download the production version or the development version.
Fit one line
$('#target').ellipsis();
Fit on two lines in the case of two or more lines
$('#target').ellipsis({
row: 2
});
Change ellipsis character
$('#target').ellipsis({
row: 2,
char: '**'
});
Only include full words (remove word fragments at the end)
$('#target').ellipsis({
row: 2,
onlyFullWords: true
});
Callback function
$('#target').ellipsis({
callback: function() {
console.log($(this).text());
}
});
Ellipsis for middle position
$('#target').ellipsis({
position: 'middle'
});
Ellipsis for tail position
$('#target').ellipsis({
position: 'tail'
});
jquery-ellipsis is available under the terms of the MIT License.