Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Truncates html text when container is resized while keeping e.g. file extensions alive.
JavaScript
branch: master

README.markdown

Usage

Basic options

$('.text li').smartTruncation();

Settings and defaults

$('.text-2 li').smartTruncation({
  "truncateCenter" : true // "Hello World" -> "hel..rld"
});
$('.files li').smartTruncation({
  "protectExtensions" : true // "myimagefile.jpg" -> "myimagef...jpg"
});

Get more info and try a demo here.

The plugin currently doesn't work too well with tables (and I realize that that's a big usecase). It's all about the CSS. If you can provide a properly scaling block-level container around the element you want to truncate, then you should be good to go. CSS is your friend.

Something went wrong with that request. Please try again.