Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Hide Portion Of Text

DZone's Guide to

Hide Portion Of Text

·
Free Resource
// Just here for my reference really


$(".discussion-item:not(.child) a p").each(function() {
    var iLimit = 155;
    var sExcerpt = $(this).html().substr(0, iLimit); // Get the visible part of the string
    var sHiddenText = $(this).html().substr(iLimit, $(this).text().length); // Get the hidden part of the string
    
    // Set the new text with 
    $(this).html(sExcerpt + "" + sHiddenText + "");
    $(".hidden").hide();
});
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}