fix pre-expand-blog check always true

This commit is contained in:
zhaospei 2023-02-07 00:26:04 +07:00
parent 4e7b8daada
commit 262514acee
4 changed files with 25 additions and 17 deletions

View file

@ -42,10 +42,18 @@
$blogbox.removeClass('pre-expand-blog');
$(this).hide();
}
})
});
$('.blog-box').each(function () {
if ($(this).prop('scrollHeight') > $(this).height()) {
var $precontent = $(this).children('.blog-description').height();
var $content = $(this).children().children('.content-description').height();
if ($content == undefined) {
$content = $(this).children().children('.md-typeset').height()
}
if ($content > $precontent - 30) {
$(this).addClass('pre-expand-blog');
} else {
$(this).children().children('.show-more').hide();
}
});
}