LLWiki正在建设中,欢迎加入我们!
“Widget:年表標籤/篩選”的版本间差异
跳转到导航
跳转到搜索
(创建页面,内容为“<includeonly><!--{if !isset($wgWidgetFilter) || !$wgWidgetFilter}--><!--{assign var="wgWidgetFilter" value=true scope="global"}--> <script> //</includeonly>JavaScrip…”) |
小 |
||
第17行: | 第17行: | ||
//</pre> |
//</pre> |
||
<includeonly> |
<includeonly> |
||
</script> |
</script><!--{/if}--></includeonly> |
2020年9月1日 (二) 02:31的版本
JavaScript脚本:
window.addEventListener('load', function() {
document.querySelectorAll('.filter').forEach(function(ele) {
ele.addEventListener('click', 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';
});
});
});
});
//