JQ 文本超出

原链接:https://blog.csdn.net/sinat_32546159/article/details/56340528

<script type="text/javascript">
    $(function () {
        $("p").each(function () {
            var maxwidth = 13;
            if ($(this).text().length > maxwidth) {
                $(this).text($(this).text().substring(0, maxwidth));
                $(this).html($(this).html() + '...[<a href="#">详细</a>]');
            }
        });
    })
</script>
原文地址:https://www.cnblogs.com/SeNaiTes/p/8892969.html