LLWiki正在建設中,歡迎加入我們!
「Widget:Bgimage」修訂間的差異
跳至導覽
跳至搜尋
小 標籤:行動版網頁編輯 行動版編輯 |
(//使用页面/文本对比查看器快速编辑) |
||
(未顯示同一使用者於中間所作的 16 次修訂) | |||
第1行: | 第1行: | ||
<noinclude>{{doc|content=请使用{{tl|背景图片}}调用。 |
<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'); |
|||
var url = ele.dataset.url; |
|||
var logo = document.querySelector('#p-logo'); |
|||
if (url.match(/llwiki\.org/)) { |
|||
var img = document.createElement('img'); |
|||
img.src = url; |
|||
ele.appendChild(img); |
|||
ele.style.opacity = ele.dataset.opacity; |
|||
document.querySelector("#mw-navigation").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; |
||
第30行: | 第13行: | ||
} |
} |
||
.bgimage img { |
.bgimage img { |
||
width: |
width: 100vw; |
||
height: |
height: 100vh; |
||
object-fit: cover; |
|||
} |
} |
||
/* </pre><includeonly> */ |
/* </pre><includeonly> */ |
||
</style> |
</style><!--{/if}--></includeonly> |
||
<!--{/if}--></includeonly> |
於 2022年5月17日 (二) 19:50 的最新修訂
小部件文檔
這個文檔是內聯文檔。
用於在桌面版添加背景圖片,請使用{{背景圖片}}調用。
外部連結
本頁面含有來自萌娘百科的文本,以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;
}
/*