Jquery.ellipsis
add ellipsis to multiline text
Install / Use
/learn @jjenzz/Jquery.ellipsisREADME
jquery.ellipsis
What is this?
.ellipsis() adds a class to the last 'allowed' line of text so you can apply text-overflow: ellipsis;. You
can view a demo on codepen.io.
How do I use it?
Add the following CSS to your stylesheet:
.ellip {
display: block;
height: 100%;
}
.ellip-line {
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
word-wrap: normal;
max-width: 100%;
}
.ellip,
.ellip-line {
position: relative;
overflow: hidden;
}
And then initialise the plugin:
$('.foo').ellipsis();
You can customise with the following options:
$('.foo').ellipsis({
lines: 3, // force ellipsis after a certain number of lines. Default is 'auto'
ellipClass: 'ellip', // class used for ellipsis wrapper and to namespace ellip line
responsive: true // set to true if you want ellipsis to update on window resize. Default is false
});
Related Skills
node-connect
339.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.8kCommit, push, and open a PR
