Truncates html text when container is resized while keeping e.g. file extensions alive.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/jasmine-1.1.0
spec
src
.gitignore
GPL-LICENSE.txt
MIT-LICENSE.txt
README.markdown

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.