echo '<script>
$(document).ready(function(){
var maxLength = 500;
$(".show-read-more").each(function(){
var myStr = $(this).html();
if($.trim(myStr).length > maxLength){
var newStr = myStr.substring(0, maxLength);
var removedStr = myStr.substring(maxLength, $.trim(myStr).length);
$(this).empty().html(newStr);
$(this).append(\'<a href="javascript:void(0);" class="read-more"><br><div align="center"><b>...continue reading...</b></div></a>\');
$(this).append(\'<span class="more-html">\'+removedStr+\'</span>\');
}
});
$(".read-more").click(function(){
$(this).siblings(".more-html").contents().unwrap();
$(this).remove();
});
});
</script>\n';
.show-read-more .more-html {
display: none;
}
<p class='show-read-more'>$body</p>
Category Forum
Modifications and Requests - 8Labels
None yet
Statistics
3 participants
Notifications
You are not receiving notifications from this thread.
Related Questions