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); }
window.addEventListener('scroll', function() {
var choose = function(){
if(eleStatic.getBoundingClientRect().top < eleFixed.getBoundingClientRect().top) {
if(eleStatic.getBoundingClientRect().top < eleFixed.getBoundingClientRect().top) {
eleFixed.style.visibility = 'hidden';
eleFixed.style.visibility = 'hidden';
第18行: 第18行:
eleStatic.style.visibility = 'hidden';
eleStatic.style.visibility = 'hidden';
}
}
});
};
choose();
window.addEventListener('scroll', choose);
});
});
//</pre>
//</pre>

於 2020年10月6日 (二) 02:07 的修訂

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); }
    var choose = function(){
        if(eleStatic.getBoundingClientRect().top < eleFixed.getBoundingClientRect().top) {
            eleFixed.style.visibility = 'hidden';
            eleStatic.style.visibility = 'visible';
        }
        else {
            eleFixed.style.visibility = '';
            eleStatic.style.visibility = 'hidden';
        }
    };
    choose();
    window.addEventListener('scroll', choose);
});
//

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);
}
@media only screen and (max-width:720px) {
	.skin-minerva .sticky-bottom {
		width: calc(100% - 32px);
		left: 16px;
	}
}
@media only screen and (min-width:720px) {
	.skin-minerva .sticky-bottom {
		width: calc(100% - 6.7rem);
		left: 3.35rem;
	}
}
/*