提交tmr底部文章空白

This commit is contained in:
2025-04-01 09:49:06 +08:00
parent 9cba7f3a7c
commit c109771398
2 changed files with 19 additions and 14 deletions

View File

@@ -39,9 +39,9 @@ function bf_list() {
wh_topicd = 'top'
var st_top_tit = "";
var st_top_con = "";
var forLength = arr_topic[i].title == "Diseases"?10:5
var forLength = arr_topic[i].title == "Diseases" ? 10 : 5
if (wh_number == '1') {
for (var j = 0; j < arr_topic[i].children.length; j++) {
if (j == forLength) break;
@@ -229,7 +229,7 @@ function bf_list() {
var mp4_ = ''
}
if (arr[i].icon == '') {
var img_i = 'img/baiss.png'
var img_i = ''
} else {
var img_i = imgarticleUrl + arr[i].icon
}
@@ -247,9 +247,13 @@ function bf_list() {
var person_img1 = '<img src="' + img_i + '" alt="" style="width: 120px">'
} else {
var person_img = '<img src="' + img_i + '" alt="" style="height:300px;object-fit: cover;">'
var person_img1 = '<div style="height: 240px;background-image: url('+img_i+');background-size:cover;background-position:top;background-repeat:no-repeat;"></div>'
if (img_i && img_i != '') {
var person_img1 = '<div style="height: 240px;background-image: url(' + img_i + ');background-size:cover;background-position:top;background-repeat:no-repeat;"></div>'
} else {
var person_img1 = '<div style="height: auto;background-image: url(' + img_i + ');background-size:cover;background-position:top;background-repeat:no-repeat;"></div>'
}
}
@@ -273,17 +277,17 @@ function bf_list() {
} else {
var traditionText = arr[i].tradition;
var maxTradHeight = 220; // 设置最大高度
trad_tion = `<div class="tradition-box" style="width:100%;height:auto;line-height:20px;overflow:hidden;">
<div class="tradition-text">${arr[i].tradition_tag}: ${traditionText}</div>
</div>`;
setTimeout(() => {
let traditionElement = document.querySelector('.tradition-text:last-of-type');
if (traditionElement.scrollHeight > maxTradHeight) {
let words = traditionText.split(" ");
let truncatedText = "";
for (let j = 0; j < words.length; j++) {
truncatedText += words[j] + " ";
traditionElement.innerText = truncatedText + "...";
@@ -296,7 +300,7 @@ function bf_list() {
}
}, 100); // 确保 DOM 渲染完成
}
str += '<li><div class="dbt_header">' + arr[i].type + '<div class="url_top">' + lr_top + '</div></div>' +
'<a id="' + arr[i].article_id + '" target="_blank" href="article.html?J_num=' + Jour_num + '&a_id=' + arr[i].article_id + '" class="txt_biaoti">' + otStat + arr[i].title + '</a>' +