<script src="https://cdnjs.cloudflare.com/ajax/libs/Readmore.js/2.2.1/readmore.js"></script>
<script>
$(document).ready(function() {
let block = $('#rec779589211'),
longText = block.find($('.t-text')),
rowHeight = Math.round(parseInt(longText.css('line-height'),10)),
collapsedHeight = rowHeight * 1,
longTextClasses = longText.attr('class');
longText.readmore({
speed: 200,
collapsedHeight: collapsedHeight,
moreLink: '<a href="#read-more" class="' + longTextClasses + ' t-name read-more"><u>Подробнее</u></a>',
lessLink: '<a href="#read-less" class="' + longTextClasses + ' t-name read-less"><u>Скрыть</u></a>',
afterToggle: function(trigger, element, expanded) {
if(expanded) {
element.removeClass('collapsed');
} else {
element.addClass('collapsed');
}
}
});
// Добавляем класс collapsed изначально
longText.addClass('collapsed');
});
</script>
<style>
.read-more,
.read-less {
color: #342a23 !important;
font-size: 24px;
font-family: 'Lato', Arial, sans-serif;
font-weight: 700;
}
#rec779589211 .t-text {
margin-bottom: 10px;
text-align: justify;
}
#rec779589211 .t-text.collapsed {
overflow:hidden;
white-space:nowrap;
text-overflow: ellipsis;
}
</style>