jquery实现多余字体省略
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>字符串超过40字截断为点点点-jq22.com</title>
<script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
<style>
</style>
</head>
<body>
<div class="cont">
我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们我们就这样
</div>
<script>
var str = $('.cont').text().substr(0, 20) + '...';
$('.cont').text(str);
</script>
</body>
</html>