Widget:背景图片:修订间差异
imported>=海豚= 无编辑摘要 |
小无编辑摘要 |
||
| (未显示2个用户的6个中间版本) | |||
| 第1行: | 第1行: | ||
<noinclude>给{{tl|背景图片}}提供更好的体验效果。</noinclude><includeonly><!--{if !isset($wgSideBarPic) || !$wgSideBarPic}--><!--{assign var="wgSideBarPic" value=true scope="global"}--><script> | <noinclude>给{{tl|背景图片}}提供更好的体验效果。</noinclude><includeonly><!--{if !isset($wgSideBarPic) || !$wgSideBarPic}--><!--{assign var="wgSideBarPic" value=true scope="global"}--><script> | ||
window. | window.addEventListener('jquery-ready', function() { | ||
$(function() { | $(function() { | ||
var sidebarCharacter = $(".sidebar-character").slice(0, 3); | var sidebarCharacter = $(".sidebar-character").slice(0, 3); | ||
| 第9行: | 第8行: | ||
var self = $(this); | var self = $(this); | ||
self.appendTo("#mw-navigation").fadeIn().addClass(this.dataset.align === 'top' ? 'top' : 'bottom').css('user-select', 'none'); | self.appendTo("#mw-navigation").fadeIn().addClass(this.dataset.align === 'top' ? 'top' : 'bottom').css('user-select', 'none'); | ||
self.find('img').removeAttr('width').removeAttr('height'); | var ele = self.find('.background-img-replace'); | ||
ele[0].outerHTML = ele[0].outerHTML.replace('<br', '<img').replace('data-srcset', 'srcset'); | |||
ele.removeAttr('width').removeAttr('height'); | |||
}); | }); | ||
$(window).on('resize', function() { | $(window).on('resize', function() { | ||
| 第22行: | 第23行: | ||
body{ | body{ | ||
background-image:none!important; | background-image:none!important; | ||
} | |||
/* 侧边栏logo或左下角图片添加 */ | |||
.sidebar-character { | |||
position: fixed; | |||
left: -3px; | |||
z-index: -2; | |||
} | |||
.sidebar-character.top { | |||
top: 0; | |||
} | |||
.sidebar-character.bottom { | |||
bottom: 0; | |||
} | } | ||
@media screen and (max-width: 600px) { | @media screen and (max-width: 600px) { | ||
| 第79行: | 第92行: | ||
#content { | #content { | ||
position: relative; | position: relative; | ||
background-color: rgb(256,256,256,. | background-color: rgb(256,256,256,.85); | ||
} | } | ||
.mw-content-ltr { | .mw-content-ltr { | ||