Truncate Text With Ellipsis Using jQuery - Text-Ellipses

Truncate Text With Ellipsis Using jQuery - Text-Ellipses

Text-Ellipses is a very small jQuery text truncation plugin which can be used to shorten text with ellipsis inside a specific DOM element.

The plugin dynamically adds custom text to your DOM elements and truncate the text to a number of characters you specify.

Also supports the hoverExpand functionality that enables the user to reveal the full text on mouse hover.

1. Import jQuery JavaScript library and the jQuery Text-Ellipses plugin's script into the html document.

<script src="" 
<script src="src/text-ellipses.jquery.js"></script>

2. Add text to your DOM element and specify the number of characters to preserve after truncating.

<a href="#" id="link"></a>
$('a').textEllipses("Long Text Here", 5)

3. Decide whether or not to enable the title attribute.

$('a').textEllipses("Long Text Here", 5,{
  showTitle: true

4. Apply custom styles to the DOM elements after the text has been truncated.

$('a').textEllipses("Long Text Here", 5,{
  className: 'text-ellipsis-element'
.text-ellipsis-element {
  /* your styles here */

5. Toggle the visibility of the truncated text on mouse hover.

$('a').textEllipses("Long Text Here", 5,{
  hoverExpand: true

This awesome jQuery plugin is developed by notetech. For more Advanced Usages, please check the demo page or visit the official website.

  • Publication date: 11.05.2018
  • Source

Whoops, looks like something went wrong.

(1/1) ErrorException

file_put_contents(): Only 0 of 246 bytes written, possibly out of free disk space

in Filesystem.php (line 122)
at HandleExceptions->handleError(2, 'file_put_contents(): Only 0 of 246 bytes written, possibly out of free disk space', '/home/p336588/web/', 122, array('path' => '/home/p336588/web/', 'contents' => 'a:3:{s:6:"_token";s:40:"f2STAvu3wH3Tz2ViejX9XxtE8ZfqBgtxNaTgihW9";s:9:"_previous";a:1:{s:3:"url";s:88:"";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}', 'lock' => true))
at file_put_contents('/home/p336588/web/', 'a:3:{s:6:"_token";s:40:"f2STAvu3wH3Tz2ViejX9XxtE8ZfqBgtxNaTgihW9";s:9:"_previous";a:1:{s:3:"url";s:88:"";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}', 2)in Filesystem.php (line 122)
at Filesystem->put('/home/p336588/web/', 'a:3:{s:6:"_token";s:40:"f2STAvu3wH3Tz2ViejX9XxtE8ZfqBgtxNaTgihW9";s:9:"_previous";a:1:{s:3:"url";s:88:"";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}', true)in FileSessionHandler.php (line 83)
at FileSessionHandler->write('2UN8kQEBLcNJnN6C98rkjkiorHZytUp4JkCR5Rf0', 'a:3:{s:6:"_token";s:40:"f2STAvu3wH3Tz2ViejX9XxtE8ZfqBgtxNaTgihW9";s:9:"_previous";a:1:{s:3:"url";s:88:"";}s:6:"_flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}')in Store.php (line 128)
at Store->save()in StartSession.php (line 88)
at StartSession->terminate(object(Request), object(Response))in Kernel.php (line 218)
at Kernel->terminateMiddleware(object(Request), object(Response))in Kernel.php (line 189)
at Kernel->terminate(object(Request), object(Response))in index.php (line 58)