我希望在文本大于300个字符后使用read more按钮.
我使用这个jQuery来解决这个问题,但它并没有按照我的意愿运行.
看到这个JSFiddle:https://jsfiddle.net/8cm67cun/1/
如何使这项工作,以显示< a> < p>之外的课程类.
最佳答案
这是更新版本https://jsfiddle.net/8cm67cun/2/现在它可以正常使用p外的标签
$j(document).on('click',function () {
$j(this).hide().parent().find('.preview').hide().prev().show();
});
$j(document).on('click',function () {
$j(this).parent().hide().next().show();
$j(this).parents('.reviewtekst').find('.read-more-link').show();
});