有觉性 以安住且中立的心 照见身心的实相
MediaWiki:Common.js:修订间差异
来自Dhamma.cn
创建页面,内容为“→这里的任何JavaScript将为所有用户在每次页面加载时加载。: →自动为所有包含 <audio> 的 EmbedVideo 容器标记 is-audio-container 类: $(function() { $('.embedvideo, .embedvideo-container, .mediaContainer').has('audio').addClass('is-audio-container'); });” |
小无编辑摘要 |
||
| 第1行: | 第1行: | ||
/* 这里的任何JavaScript将为所有用户在每次页面加载时加载。 */ | /* 这里的任何JavaScript将为所有用户在每次页面加载时加载。 */ | ||
/* | |||
/* =================================================== | |||
彻底修复 EmbedVideo 音频 16:9 宽高比限制与消失问题 | |||
=================================================== */ | |||
$(function() { | $(function() { | ||
$('.embedvideo, .embedvideo-container, .mediaContainer'). | $('audio').each(function() { | ||
var $audio = $(this); | |||
// 1. 设置音频标签本身的宽度和显示 | |||
$audio.attr('style', 'display: block !important; width: 100% !important; max-width: 640px !important; height: 44px !important; margin: 0 auto !important; position: static !important; visibility: visible !important; opacity: 1 !important;'); | |||
// 2. 向上寻找 EmbedVideo 生成的 wrapper 外壳,强行清空 padding-bottom 限制 | |||
var $parents = $audio.parents('.embedvideo-wrapper, .embedvideo, .embedvideo-container, .mediaContainer, [class*="embedvideo"]'); | |||
$parents.each(function() { | |||
$(this).attr('style', function(i, style) { | |||
return (style || '') + '; padding-bottom: 0 !important; height: auto !important; min-height: 44px !important; max-width: 640px !important; margin: 15px auto !important; overflow: visible !important;'; | |||
}); | |||
}); | |||
}); | |||
}); | }); | ||
2026年8月14日 (五) 05:34的版本
/* 这里的任何JavaScript将为所有用户在每次页面加载时加载。 */
/* ===================================================
彻底修复 EmbedVideo 音频 16:9 宽高比限制与消失问题
=================================================== */
$(function() {
$('audio').each(function() {
var $audio = $(this);
// 1. 设置音频标签本身的宽度和显示
$audio.attr('style', 'display: block !important; width: 100% !important; max-width: 640px !important; height: 44px !important; margin: 0 auto !important; position: static !important; visibility: visible !important; opacity: 1 !important;');
// 2. 向上寻找 EmbedVideo 生成的 wrapper 外壳,强行清空 padding-bottom 限制
var $parents = $audio.parents('.embedvideo-wrapper, .embedvideo, .embedvideo-container, .mediaContainer, [class*="embedvideo"]');
$parents.each(function() {
$(this).attr('style', function(i, style) {
return (style || '') + '; padding-bottom: 0 !important; height: auto !important; min-height: 44px !important; max-width: 640px !important; margin: 15px auto !important; overflow: visible !important;';
});
});
});
});
