css隐藏超出部分,用省略号显示。。。

<div class="zxx_text_overflow_5" title="表头">
     内容

</div>


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

你可能感兴趣的:(css隐藏超出部分,用省略号显示。。。)