<script type="text/javascript">
$(document).ready(function(){
//限制字符个数
$(".contents").each(function(){ //contents 是标签
var maxnum=3;
if($(this).text().length>maxnum){
$(this).text($(this).text().substring(0,maxnum));
$(this).html($(this).html()+'...');
}
});
});
</script>
$(document).ready(function(){
//限制字符个数
$(".contents").each(function(){ //contents 是标签
var maxnum=3;
if($(this).text().length>maxnum){
$(this).text($(this).text().substring(0,maxnum));
$(this).html($(this).html()+'...');
}
});
});
</script>