LLWiki正在建设中,欢迎加入我们!
“Widget:游戏主界面”的版本间差异
跳转到导航
跳转到搜索
小 |
小 |
||
第1行: | 第1行: | ||
<noinclude>{{doc|content=请使用[[:category:导航模板]]调用。}}</noinclude><includeonly><!--{if !isset($wgWidgetStartScreen) || !$wgWidgetStartScreen}--><!--{assign var="wgWidgetStartScreen" value=true scope="global"}--><script> |
<noinclude>{{doc|content=请使用[[:category:导航模板|导航模板]]调用。}}</noinclude><includeonly><!--{if !isset($wgWidgetStartScreen) || !$wgWidgetStartScreen}--><!--{assign var="wgWidgetStartScreen" value=true scope="global"}--><script> |
||
//</includeonly>JavaScript脚本:<pre lang="js"> |
//</includeonly>JavaScript脚本:<pre lang="js"> |
||
window.addEventListener('load', function () { |
window.addEventListener('load', function () { |
2020年10月7日 (三) 03:18的版本
JavaScript脚本:
window.addEventListener('load', function () {
var ele = document.querySelector('.start-screen'),
parent = document.querySelector('#mw-content-text > .mw-parser-output');
ele.querySelectorAll('a[href]').forEach(function(e) {
var href = decodeURIComponent(e.href),
section = /#/.test(href),
pagename = section ? href.match('^(?:https:)?(?:\/\/llwiki\.org)?/zh/(.*)#')[1] : href.match('^(?:https:)?(?:\/\/llwiki\.org)?/zh/(.*)$')[1];
if(pagename == mw.config.get('wgPageName')) {
e.href = section ? href.match(/#.*$/)[0] : 'javascript:void(0)';
}
});
if(mw.config.get('skin') == 'minerva') { parent.appendChild(ele); }
});
//
CSS样式表:
*/
.start-screen {
text-align: center;
position: sticky;
bottom: 3px;
}
.start-screen table {
display: inline-table;
}
/*