LLWiki正在建設中,歡迎加入我們!
「Widget:游戏主界面」修訂間的差異
跳至導覽
跳至搜尋
小 標籤:流動版網頁編輯 流動版編輯 |
小 標籤:流動版網頁編輯 流動版編輯 |
||
第13行: | 第13行: | ||
}); |
}); |
||
if(mw.config.get('skin') == 'minerva') { |
if(mw.config.get('skin') == 'minerva') { |
||
ele.querySelectorAll( '.lazy-image-placeholder' ).forEach(function(e) { |
|||
local img = document.createElement('img'); |
local img = document.createElement('img'); |
||
img.src = |
img.src = e.dataset.src; |
||
e.replaceWith(img); |
|||
}); |
}); |
||
parent.appendChild(ele); |
parent.appendChild(ele); |
於 2020年10月9日 (五) 09:40 的修訂
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') {
ele.querySelectorAll( '.lazy-image-placeholder' ).forEach(function(e) {
local img = document.createElement('img');
img.src = e.dataset.src;
e.replaceWith(img);
});
parent.appendChild(ele);
ele.scrollLeft = (ele.scrollWidth - ele.clientWidth) / 2;
}
});
//
CSS樣式表:
*/
.start-screen {
text-align: center;
position: sticky;
bottom: 3px;
white-space: nowrap;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
scroll-snap-type: x mandatory;
}
.start-screen a {
scroll-snap-align: start;
}
.start-screen table {
display: inline-table;
margin: 0;
}
/*