Here is a solution that wraps content in a container, and uses a more/less button to expand/contract the container to show the content:
var content = $('.content').wrapInner('<div class="moreless less">');
$('.moreless').after('<div class="showbutton"><span>More</span><span class="hidden">Less</span></div>');
$('.content').on('click', '.showbutton', function() {
$(this).prev('.moreless').toggleClass('less');
$(this).find('span').toggleClass('hidden');
});
CSS:
.content {
line-height: 20px;
}
.less {
max-height: 100px;
overflow: hidden;
}
.hidden {
display: none;
}
You would need to put some checks in to make sure you aren't adding a more
button when the content is smaller than the container.