Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 680 Bytes

README.markdown

File metadata and controls

22 lines (16 loc) · 680 Bytes

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.