Skip to content
This repository has been archived by the owner on Dec 27, 2017. It is now read-only.

STAR-ZERO/jquery-ellipsis

Repository files navigation

THIS PLUGIN IS NO LONGER BEING MAINTAINED

jQuery ellipsis Build Status Coverage Status Dependency Status

Support multiple lines ellipsis

http://plugins.jquery.com/ellipsis/

Getting Started

Download the production version or the development version.

Usage

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'
});

License

jquery-ellipsis is available under the terms of the MIT License.