LLWiki正在建设中,欢迎加入我们!
“Widget:游戏主界面”的版本间差异
跳转到导航
跳转到搜索
(创建页面,内容为“<noinclude>{{doc|content=请使用{{tl|SIF nav}}调用。}}</noinclude><includeonly><!--{if !isset($wgWidgetStartScreen) || !$wgWidgetStartScreen}--><!--{assign var=…”) |
小 |
||
第4行: | 第4行: | ||
var eleStatic = document.querySelector('.start-screen'); |
var eleStatic = document.querySelector('.start-screen'); |
||
eleStatic.querySelectorAll('a').forEach(function(ele) { |
eleStatic.querySelectorAll('a').forEach(function(ele) { |
||
ele.href = 'javascript:void(0)'; |
|||
}); |
}); |
||
var eleFixed = eleStatic.cloneNode(true); |
var eleFixed = eleStatic.cloneNode(true); |
||
第25行: | 第25行: | ||
</script><style> |
</script><style> |
||
/* </includeonly>CSS样式表:<pre lang="css"> */ |
/* </includeonly>CSS样式表:<pre lang="css"> */ |
||
.start-screen { |
.start-screen table { |
||
text-align: center; |
|||
left: 50%; |
|||
} |
|||
transform: translateX(-50%); |
|||
.start-screen table { |
|||
display: inline-table; |
|||
} |
} |
||
.sticky-bottom { |
.sticky-bottom { |
2020年10月5日 (一) 23:17的版本
JavaScript脚本:
window.addEventListener('load', function () {
var eleStatic = document.querySelector('.start-screen');
eleStatic.querySelectorAll('a').forEach(function(ele) {
ele.href = 'javascript:void(0)';
});
var eleFixed = eleStatic.cloneNode(true);
eleFixed.classList.add('sticky-bottom');
eleFixed.insertBefore(eleStatic);
eleStatic.style.visibility = 'hidden';
window.addEventListener('scroll', function() {
if(eleStatic.offsetTop > eleFixed.offsetTop) {
eleFixed.style.display = 'none';
eleStatic.style.visibility = '';
}
else {
eleFixed.style.display = '';
eleStatic.style.visibility = 'hidden';
}
});
});
//
CSS样式表:
*/
.start-screen table {
text-align: center;
}
.start-screen table {
display: inline-table;
}
.sticky-bottom {
position: fixed;
bottom: 3px;
}
/*