Skip to content
A tiny jQuery plugin for truncating multiple lines of text
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Built succinct from commit 85cace2 on branch development Oct 5, 2014
README.md Update README.md Jul 14, 2017
bower.json Built succinct from commit 85cace2 on branch development Oct 5, 2014
jQuery.succinct.js
jQuery.succinct.min.js Built succinct from commit 85cace2 on branch development Oct 5, 2014

README.md

Succinct

A tiny jQuery plugin for truncating multiple lines of text

How does it work?

Succinct shortens your text to a specified size, and then adds an ellipsis to the end.

Demo

Live Demo: http://micjamking.github.io/succinct/

Usage

Specify the elements that you would like to truncate as a selector, and then set the size parameter to the amount you would like to see. For example, if you would like to truncate all elements with a specific class, ie. <p class="truncate"> to 120 characters...

<script>
    $(function(){
        $('.truncate').succinct({
            size: 120
        });
    });
</script>

By default, the plugin truncates text to 240 characters.

To change the ellipsis to an HTML unicode arrow "→"...

<script>
    $(function(){
        $('.truncate').succinct({
            omission: '&rarr;'
        });
    });
</script>

By default, the plugin also removes the set of 32 ASCII special characters at the end of words, ie. ! " # $ and so on. To disable this behavior...

<script>
    $(function(){
        $('.truncate').succinct({
            ignore: false
        });
    });
</script>

Details

Copyright

MIT license Copyright (c) 2014 Mike King (@micjamking)

You can’t perform that action at this time.