LLWiki正在建设中,欢迎加入我们!
“Widget:Lyrics”的版本间差异
跳转到导航
跳转到搜索
小 |
小 标签:移动版网页编辑 移动版编辑 |
||
第1行: | 第1行: | ||
<noinclude>{{doc|content={{tl|Lyrics}}。}}</noinclude><includeonly><!--{if !isset($wgLyrics) || !$wgLyrics}--><!--{assign var="wgLyrics" value=true scope="global"}-->< |
<noinclude>{{doc|content={{tl|Lyrics}}。}}</noinclude><includeonly><!--{if !isset($wgLyrics) || !$wgLyrics}--><!--{assign var="wgLyrics" value=true scope="global"}--><script> |
||
//</includeonly>Javascript脚本:<pre lang="js"> |
|||
window.addEventListener('load', function () { |
|||
document.querySelector('.Lyrics_box').forEach(function(ele) { |
|||
var width = ele.dataset.width; |
|||
if(width.match(/^-.*/)) { width = 'calc(100%' + width + ')'; } |
|||
mw.loader.using('mediawiki.util').then(function() { |
|||
mw.util.addCSS('@media only screen and (min-width:720px) { .Lyrics_box { width:' + width + '; } }'); |
|||
}; |
|||
}); |
|||
}); |
|||
:cssText('@media only screen and (min-width:720px) { width:'..(args.width or 'calc(100% - '..(args.reserveWidth or '290px')..')')..'; }') --设置宽度或留白宽度。默认为留白290px。 |
|||
//</pre> |
|||
<includeonly> |
|||
</script> |
|||
<style> |
|||
/* </includeonly>CSS样式表:<pre lang="css"> */ |
/* </includeonly>CSS样式表:<pre lang="css"> */ |
||
.Lyrics_box { |
.Lyrics_box { |
2020年8月14日 (五) 07:15的版本
Javascript脚本:
window.addEventListener('load', function () {
document.querySelector('.Lyrics_box').forEach(function(ele) {
var width = ele.dataset.width;
if(width.match(/^-.*/)) { width = 'calc(100%' + width + ')'; }
mw.loader.using('mediawiki.util').then(function() {
mw.util.addCSS('@media only screen and (min-width:720px) { .Lyrics_box { width:' + width + '; } }');
};
});
});
:cssText('@media only screen and (min-width:720px) { width:'..(args.width or 'calc(100% - '..(args.reserveWidth or '290px')..')')..'; }') --设置宽度或留白宽度。默认为留白290px。
//
CSS样式表:
*/
.Lyrics_box {
width: 100%;
max-width: 1080px;
display: inline-block;
}
.Lyrics_box.Lyrics_has_ruby .Lyrics_original,
.Lyrics_box.Lyrics_has_ruby .Lyrics_translated {
line-height: 2.1;
}
.Lyrics.Lyrics_no-ruby .Lyrics_original,
.Lyrics.Lyrics_no-ruby .Lyrics_translated {
vertical-align: top;
}
.Lyrics_box .Lyrics_original,
.Lyrics_box .Lyrics_translated {
width: 49.85%;
min-width: 480px;
display: inline-block;
white-space: pre-wrap;
}
/*