LLWiki正在建设中,欢迎加入我们!
“Widget:Bgimage”的版本间差异
跳转到导航
跳转到搜索
小 (// Edit via Wikiplus) |
标签:移动版网页编辑 移动版编辑 |
||
第12行: | 第12行: | ||
} |
} |
||
if (ele.dataset.logo == 'off') { |
if (ele.dataset.logo == 'off') { |
||
document.querySelector('#p-logo') |
var logo = document.querySelector('#p-logo'); |
||
if(logo) { logo.style.visibility = 'hidden'; } |
|||
} |
} |
||
}); |
}); |
2020年8月11日 (二) 07:36的版本
Javascript脚本:
window.addEventListener('load', function () {
var ele = document.querySelector('.bgimage');
var url = ele.dataset.url;
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') {
var logo = document.querySelector('#p-logo');
if(logo) { logo.style.visibility = 'hidden'; }
}
});
//
CSS样式表:
*/
.bgimage {
position: fixed;
left: 0;
top: 0;
z-index: -2;
}
.bgimage img {
width: 100%;
height: auto;
}
/*