Javascript 默认情况下,如何显示所有描述已展开的YouTube视频?
我认为策展人的脚本决定了CSS的大小,但我不能完全正确 在这个jsfiddle中,您将看到:Javascript 默认情况下,如何显示所有描述已展开的YouTube视频?,javascript,html,css,mobile,stylesheet,Javascript,Html,Css,Mobile,Stylesheet,我认为策展人的脚本决定了CSS的大小,但我不能完全正确 在这个jsfiddle中,您将看到: 直接在网站上查看可能更容易: 在显示内容的地方,前两个YouTube视频有阅读更多按钮,下两个完全展开 我希望页面上的所有四个按钮(即使在使用Next按钮时也是如此)都能完全展开,而不必使用readmore按钮 我尝试将填充顶部从4em调整到0em,结果几乎正确,但仍然有一点透明的模糊 .crt-post-v2.crt-post-max-height .crt-post-max-height-rea
直接在网站上查看可能更容易:
在显示内容的地方,前两个YouTube视频有
阅读更多
按钮,下两个完全展开
我希望页面上的所有四个按钮(即使在使用Next
按钮时也是如此)都能完全展开,而不必使用readmore
按钮
我尝试将填充顶部
从4em
调整到0em
,结果几乎正确,但仍然有一点透明的模糊
.crt-post-v2.crt-post-max-height .crt-post-max-height-read-more {
display: block;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
text-align: center;
padding-bottom: 0.5em;
padding-top: 4em;
margin: 0em;
background: transparent;
background: -webkit-gradient(left top, left bottom, color-stop(0%, transparent), color-stop(50%, #efefef));
background: linear-gradient(to bottom, transparent 0%, #efefef 50%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#000000', GradientType=0);
}
不要做太多的前端或移动开发了,所以任何和所有的帮助将不胜感激。请帮忙
我希望他们都像这样:
我想你所要做的就是移除显示:块;然后将新的“最大高度”设置为适当的值。600px或类似的东西有一个内联的
max height:316px
样式,这就是原因
这是完整的解决方案。查看下面的代码笔
您必须更改CSS中的以下值:
max height
和min height
类的所有元素上的值。crt-post-c和类的所有元素上的显示值
。crt post max height阅读更多类似以下内容:
var crtPosts = document.querySelectorAll('.crt-post-c'),
crtPostsReadMore = document.querySelectorAll('.crt-post-max-height-read-more');
for(var i = crtPosts.length; i--;)
{
crtPosts[i].style.maxHeight = '800px';
crtPosts[i].style.minHeight = '400px';
}
for(var i = crtPostsReadMore.length; i--;)
crtPostsReadMore[i].style.display = 'none';
这是。
我希望这就是你想要的。这似乎适用于单个youtube框,但不是所有的。我需要它们全部被完全扩展。嗨@Bharata,现在请在代码笔中找到代码,谢谢你的帮助。
var crtPosts = document.querySelectorAll('.crt-post-c'),
crtPostsReadMore = document.querySelectorAll('.crt-post-max-height-read-more');
for(var i = crtPosts.length; i--;)
{
crtPosts[i].style.maxHeight = '800px';
crtPosts[i].style.minHeight = '400px';
}
for(var i = crtPostsReadMore.length; i--;)
crtPostsReadMore[i].style.display = 'none';