Minimalist Multi-line Text Truncation Plugin For jQuery - trunc.js

File Size: 5.02 KB
Views Total: 539
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Minimalist Multi-line Text Truncation Plugin For jQuery - trunc.js

The simplest jQuery based text truncation plugin which truncates multi-line text to a specific number of characters with ellipsis. It will reveal the full text when the user clicks on the ellipsis.

Basic usage:

1. Place jQuery library and the jQuery trunc.js script at the bottom of your html page.

<script src="//code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="dist/jquery.trunc.min.js"></script>

2. Call the function on the text wrapper and specify how many number of characters should be truncated.

$('.container').trunc(140);

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