字符串进行截取显示插件:jQuery.smarttruncation

jopen 11年前

SmartTruncation 可自动根据容器的大小变化时,对容器内部的字符串进行截取显示,并可保留一些固定的内容,例如文件扩展名之类的。

示例代码:

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

项目主页:http://www.open-open.com/lib/view/home/1361240637666