- Issue created by @thomas.frobieter
- 🇮🇳India Muskan kumari
Hello,
we can do this by jquery:
below is jquery for this:var showChar = 100;
var ellipsestext = "...";
var moretext = "Show more >";
var lesstext = "Show less";jQuery('.content p').each(function() {
var content = jQuery(this).html();if(content.length > showChar) {
var c = content.substr(0, showChar);
var h = content.substr(showChar, content.length - showChar);var html = c + '' + ellipsestext+ ' ' + h + ' ' + moretext + '';
jQuery(this).html(html);
}});
jQuery(".morelink").click(function(){
if(jQuery(this).hasClass("less")) {
jQuery(this).removeClass("less");
jQuery(this).html(moretext);
} else {
jQuery(this).addClass("less");
jQuery(this).html(lesstext);
}
jQuery(this).parent().prev().toggle();
jQuery(this).prev().toggle();
return false;
}); - 🇩🇪Germany Anybody Porta Westfalica
Moved to https://www.drupal.org/project/drowl_paragraphs_bs → for future implementation.
Its well supported in meantime, so we can start using this! https://caniuse.com/?search=line-clamp