LLWiki正在建设中,欢迎加入我们!
“Widget:年表標籤/篩選”的版本间差异
跳转到导航
跳转到搜索
小 |
小 标签:移动版网页编辑 移动版编辑 |
||
第5行: | 第5行: | ||
document.querySelectorAll('.filter').forEach(function(ele) { |
document.querySelectorAll('.filter').forEach(function(ele) { |
||
ele.addEventListener('click', function() { |
ele.addEventListener('click', function() { |
||
setTimeout(function() { |
|||
document.querySelectorAll('#mw-content-text dl').forEach(function(parent) { |
|||
var child = parent.querySelector('dd > :not(.mw-collapsed)'); |
|||
if(child) |
|||
parent.style.display = ''; |
|||
else |
|||
parent.style.display = 'none'; |
|||
}); |
|||
}, 50); |
|||
}); |
}); |
||
}); |
}); |
2020年9月1日 (二) 02:35的版本
JavaScript脚本:
window.addEventListener('load', function() {
document.querySelectorAll('.filter').forEach(function(ele) {
ele.addEventListener('click', function() {
setTimeout(function() {
document.querySelectorAll('#mw-content-text dl').forEach(function(parent) {
var child = parent.querySelector('dd > :not(.mw-collapsed)');
if(child)
parent.style.display = '';
else
parent.style.display = 'none';
});
}, 50);
});
});
});
//