LLWiki正在建设中,欢迎加入我们!
“Widget:游戏主界面”的版本间差异
跳转到导航
跳转到搜索
小 |
小 标签:移动版网页编辑 移动版编辑 |
||
第2行: | 第2行: | ||
//</includeonly>JavaScript脚本:<pre lang="js"> |
//</includeonly>JavaScript脚本:<pre lang="js"> |
||
window.addEventListener('load', function () { |
window.addEventListener('load', function () { |
||
document.querySelectorAll('.start-screen a').forEach(function(ele) { |
|||
eleStatic.querySelectorAll('a').forEach(function(ele) { |
|||
ele.href = 'javascript:void(0)'; |
ele.href = 'javascript:void(0)'; |
||
}); |
}); |
||
var eleStatic = document.querySelector('.start-screen'); |
|||
document.querySelector('#mw-content-text > .mw-parser-output').appendChild(eleStatic); |
|||
var eleFixed = eleStatic.cloneNode(true); |
var eleFixed = eleStatic.cloneNode(true); |
||
eleFixed.classList.add('sticky-bottom'); |
|||
eleStatic.parentNode.insertBefore(eleFixed, eleStatic); |
|||
eleFixed.style.width = eleStatic.getBoundingClientRect().width + 'px'; |
eleFixed.style.width = eleStatic.getBoundingClientRect().width + 'px'; |
||
eleStatic.style.visibility = 'hidden'; |
eleStatic.style.visibility = 'hidden'; |
2020年10月6日 (二) 01:14的版本
JavaScript脚本:
window.addEventListener('load', function () {
document.querySelectorAll('.start-screen a').forEach(function(ele) {
ele.href = 'javascript:void(0)';
});
var eleStatic = document.querySelector('.start-screen');
document.querySelector('#mw-content-text > .mw-parser-output').appendChild(eleStatic);
var eleFixed = eleStatic.cloneNode(true);
eleFixed.style.width = eleStatic.getBoundingClientRect().width + 'px';
eleStatic.style.visibility = 'hidden';
window.addEventListener('scroll', function() {
if(eleStatic.getBoundingClientRect().top < eleFixed.getBoundingClientRect().top) {
eleFixed.style.visibility = 'hidden';
eleStatic.style.visibility = '';
}
else {
eleFixed.style.visibility = '';
eleStatic.style.visibility = 'hidden';
}
});
});
//
CSS样式表:
*/
.start-screen {
text-align: center;
}
.start-screen table {
display: inline-table;
}
.sticky-bottom {
position: fixed;
bottom: 3px;
}
/*