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

“Widget:Bgimage”的版本间差异

来自LLWiki
跳转到导航 跳转到搜索
(//使用页面/文本对比查看器快速编辑)
 
(未显示同一用户的9个中间版本)
第1行: 第1行:
<noinclude>{{doc|content=请使用{{tl|背景图片}}调用。}}</noinclude><includeonly><!--{if !isset($wgBgimage) || !$wgBgimage}--><!--{assign var="wgBgimage" value=true scope="global"}--><div><script>
<noinclude>{{doc|content=用于在桌面版添加背景图片,请使用{{tl|背景图片}}调用。

//</includeonly>JavaScript脚本:<pre lang=js>
==外部链接==
window.addEventListener('load', function () {
{{CCnotice|MGP=widget:sideBarPic}}}}[[category:混合小部件]]
if(mw.config.get('skin') == 'vector') {
<p>JavaScript脚本:[[User:Bhsd/widget/bgimage.js]]</p></noinclude><includeonly><!--{if !isset($wgBgimage) || !$wgBgimage}--><!--{assign var="wgBgimage" value=true scope="global"}--><script defer src="/zh?title=user:bhsd/widget/bgimage.js&action=raw&ctype=text/javascript"></script><style>
var ele = document.querySelector('.bgimage'),
url = ele.dataset.url,
logo = document.querySelector('#p-logo');
if (/^(?:(?:https:)?\/\/llwiki\.org)?\/mediawiki\//.test( url )) {
var img = document.createElement('img');
img.src = url;
img.style.objectPosition = ele.dataset.position;
ele.appendChild(img);
ele.style.opacity = ele.dataset.opacity;
document.body.appendChild(ele);
}
if (ele.dataset.logo == 'off') { logo.style.visibility = 'hidden'; }
}
});
//</pre>
<includeonly>
</script><style>
/* </includeonly>CSS样式表:<pre lang="css"> */
/* </includeonly>CSS样式表:<pre lang="css"> */
.bgimage {
.bgimage {
display: none;
position: fixed;
position: fixed;
left: 0;
left: 0;
第33行: 第18行:
}
}
/* </pre><includeonly> */
/* </pre><includeonly> */
</style></div><!--{/if}--></includeonly>
</style><!--{/if}--></includeonly>

2022年5月17日 (二) 19:50的最新版本

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

用于在桌面版添加背景图片,请使用{{背景图片}}调用。

外部链接

本页面含有来自萌娘百科的文本,以CC BY-NC-SA 3.0授权引入。经过双方的修改,内容可能已与来源有很大差异。

JavaScript脚本:User:Bhsd/widget/bgimage.js

CSS样式表:

 */
.bgimage {
	display: none;
	position: fixed;
	left: 0;
	top: 0;
	z-index: -2;
}
.bgimage img {
	width: 100vw;
	height: 100vh;
	object-fit: cover;
}
/*