LLWiki正在建设中,欢迎加入我们

“Widget:游戏主界面”的版本间差异

来自LLWiki
跳转到导航 跳转到搜索
标签移动版网页编辑 移动版编辑
第9行: 第9行:
parent = document.querySelector('#mw-content-text > .mw-parser-output');
parent = document.querySelector('#mw-content-text > .mw-parser-output');
if(mw.config.get('skin') == 'minerva') { parent.appendChild(eleStatic); }
if(mw.config.get('skin') == 'minerva') { parent.appendChild(eleStatic); }
eleFixed.style.width = eleStatic.getBoundingClientRect().width + 'px';
eleStatic.style.visibility = 'hidden';
window.addEventListener('scroll', function() {
window.addEventListener('scroll', function() {
if(eleStatic.getBoundingClientRect().top < eleFixed.getBoundingClientRect().top) {
if(eleStatic.getBoundingClientRect().top < eleFixed.getBoundingClientRect().top) {
eleFixed.style.visibility = 'hidden';
eleFixed.style.visibility = 'hidden';
eleStatic.style.visibility = '';
eleStatic.style.visibility = 'visible';
}
}
else {
else {
第31行: 第29行:
.start-screen table {
.start-screen table {
display: inline-table;
display: inline-table;
}
.static-bottom {
visibility: hidden;
}
}
.sticky-bottom {
.sticky-bottom {
position: fixed;
position: fixed;
bottom: 3px;
bottom: 3px;
}
.skin-vector .sticky-bottom {
width: calc(100% - 14rem);
}
.skin-vector .sticky-bottom {
width: 100%;
left: 0;
}
}
/* </pre><includeonly> */
/* </pre><includeonly> */

2020年10月6日 (二) 01:54的版本

Template-info.png 小部件文档
这个文档是内联文档。

请使用{{SIF nav}}调用。

JavaScript脚本:

window.addEventListener('load', function () {
    document.querySelectorAll('.start-screen a').forEach(function(ele) {
        ele.href = 'javascript:void(0)';
    });
    var eleStatic = document.querySelector('.static-bottom'),
        eleFixed = document.querySelector('.sticky-bottom'),
        parent = document.querySelector('#mw-content-text > .mw-parser-output');
    if(mw.config.get('skin') == 'minerva') { parent.appendChild(eleStatic); }
    window.addEventListener('scroll', function() {
        if(eleStatic.getBoundingClientRect().top < eleFixed.getBoundingClientRect().top) {
            eleFixed.style.visibility = 'hidden';
            eleStatic.style.visibility = 'visible';
        }
        else {
            eleFixed.style.visibility = '';
            eleStatic.style.visibility = 'hidden';
        }
    });
});
//

CSS样式表:

 */
.start-screen {
	text-align: center;
}
.start-screen table {
	display: inline-table;
}
.static-bottom {
	visibility: hidden;
}
.sticky-bottom {
	position: fixed;
	bottom: 3px;
}
.skin-vector .sticky-bottom {
	width: calc(100% - 14rem);
}
.skin-vector .sticky-bottom {
	width: 100%;
	left: 0;
}
/*