LLWiki正在建设中,欢迎加入我们!
“Widget:游戏主界面”的版本间差异
跳转到导航
跳转到搜索
小 |
小 |
||
第2行: | 第2行: | ||
//</includeonly>JavaScript脚本:<pre lang="js"> |
//</includeonly>JavaScript脚本:<pre lang="js"> |
||
window.addEventListener('load', function () { |
window.addEventListener('load', function () { |
||
document. |
var ele = document.querySelector('.start-screen'), |
||
⚫ | |||
⚫ | |||
ele.querySelectorAll('a').forEach(function(e) { |
|||
⚫ | |||
}); |
}); |
||
⚫ | |||
var eleStatic = document.querySelector('.static-bottom'), |
|||
eleFixed = document.querySelector('.sticky-bottom'), |
|||
⚫ | |||
⚫ | |||
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); |
|||
}); |
}); |
||
//</pre> |
//</pre> |
||
第28行: | 第15行: | ||
.start-screen { |
.start-screen { |
||
text-align: center; |
text-align: center; |
||
⚫ | |||
⚫ | |||
} |
} |
||
.start-screen table { |
.start-screen table { |
||
display: inline-table; |
display: inline-table; |
||
} |
|||
.static-bottom { |
|||
visibility: hidden; |
|||
} |
|||
.sticky-bottom { |
|||
⚫ | |||
⚫ | |||
} |
|||
.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; |
|||
} |
|||
} |
} |
||
/* </pre><includeonly> */ |
/* </pre><includeonly> */ |
2020年10月6日 (二) 09:11的版本
JavaScript脚本:
window.addEventListener('load', function () {
var ele = document.querySelector('.start-screen'),
parent = document.querySelector('#mw-content-text > .mw-parser-output');
ele.querySelectorAll('a').forEach(function(e) {
e.href = '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;
}
/*