LLWiki正在建设中,欢迎加入我们!
Widget:Sif-song-table
Bhsd(讨论 | 贡献)2020年10月15日 (四) 04:32的版本 (创建页面,内容为“<noinclude>{{doc|content=用于LoveLive!学园偶像祭歌曲列表。}}</noinclude><includeonly><!--{if !isset($wgWidgetSifSongTable) || !$wgWidgetSifSongTable}…”)
JavaScript脚本:
window.addEventListener('load', function() {
document.querySelectorAll( '.sif-song-table' ).forEach(function(table) {
table.querySelectorAll( '.tabs-dropdown li' ).forEach(function(ele, i) {
ele.onclick = function() {
table.querySelector( '.tabs-label' ).textContent = ele.textContent;
table.querySelectorAll( 'td:nth-last-child(-n+2) > span' ).forEach(function(e) {
e.style.display = '';
});
table.querySelectorAll( 'td:nth-last-child(-n+2) > span:nth-child(' + (i+1) + ')' ).forEach(function(e) {
e.style.display = 'initial';
});
};
});
});
});
//
CSS样式表:
*/
.sif-song-table {
text-align:center;
}
.sif-song-table .tabs-content {
border-radius:0 0 8px 8px;
}
.sif-song-table .tabs-dropdown ul {
background-color:#f8f9fa;
}
.sif-song-table .tabs-dropdown li:last-child {
border-radius:0 0 8px 8px;
}
.sif-song-table td:nth-last-child(-n+2) > span {
display:none;
}
/*