提交
This commit is contained in:
@@ -106,7 +106,7 @@ function initOid() {
|
||||
str += `
|
||||
|
||||
<li>
|
||||
<div class="dbt_header">${arr[i].type}${baseInfo.pub_date}</div><a id="${arr[i].article_id}" target="_blank"
|
||||
<div class="dbt_header" style="height: 37px;line-height: 32px;">${arr[i].type}${baseInfo.pub_date}<div class="url_top">${baseInfo.lr_top}</div></div><a id="${arr[i].article_id}" target="_blank"
|
||||
href="article.html?J_num=${arr[i].journal_id}&a_id=${arr[i].article_id}"
|
||||
class="txt_biaoti">${baseInfo.otStat}${arr[i].title}</a>
|
||||
<div class="authorList">${arr[i].authortitle}<br>
|
||||
@@ -124,7 +124,47 @@ function initOid() {
|
||||
$('.wenz_list>ul').html(str);
|
||||
$('.links_ .txt_copy').css('background', localStorage.Journals_color);
|
||||
commonHandleClickHtml()
|
||||
addStyleToElement();
|
||||
}
|
||||
function addStyleToElement() {
|
||||
// 获取所有具有 .url_top 类的元素
|
||||
var elements = document.querySelectorAll('.article .art_main .new_art > ul li .url_top');
|
||||
|
||||
elements.forEach(function(element) {
|
||||
element.style.margin = '0 0 0 20px';
|
||||
element.style.display = 'inline-block';
|
||||
});
|
||||
|
||||
// 获取所有具有 .url_top a 类的元素
|
||||
var links = document.querySelectorAll('.article .art_main .new_art > ul li .url_top a');
|
||||
|
||||
links.forEach(function(link) {
|
||||
link.style.marginRight = '10px';
|
||||
link.style.padding = '3px 0';
|
||||
link.style.fontFamily = 'Calibri';
|
||||
link.style.fontSize = '15px';
|
||||
});
|
||||
|
||||
// 设置最后一个 a 元素的 margin-right 为 0
|
||||
var lastLink = document.querySelector('.article .art_main .new_art > ul li .url_top a:last-child');
|
||||
if (lastLink) {
|
||||
lastLink.style.marginRight = '0';
|
||||
}
|
||||
|
||||
// 为 a 元素添加 hover 效果
|
||||
links.forEach(function(link) {
|
||||
link.addEventListener('mouseenter', function() {
|
||||
link.style.textDecoration = 'underline';
|
||||
});
|
||||
link.addEventListener('mouseleave', function() {
|
||||
link.style.textDecoration = 'none';
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 调用函数将样式应用到元素
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user