当前位置:网站首页>分屏bug 小记
分屏bug 小记
2022-07-07 11:09:00 【白杨攻城狮】
继上篇分屏完成后,发现最下面的控制div受浮动影响,移动到了最上面,这是不合理的,所以对其设置了清除浮动 overflow: hidden 属性,但是这里产生了新的问题,点击4分屏后,页面出现了滚动条。这里可以看出设置的宽高是不合理的,所以要进行精确设置。
首先我们需要设置容纳video标签的div的大小。在页面加载完成后,通过加载完成事件来设置,加粗部分,为设置容纳video标签的div.后面的代码为设置单video标签的宽高,由于设置了margin:2px.所以需要宽高都要减去4个像素。
mounted() {
this.$nextTick(() => {
//设置
let player = document.getElementsByClassName('player');
console.log(player);
player[0].width = window.innerWidth - 400;
player[0].height = window.innerHeight - 80 - 60;
let vi = document.getElementById(1);
vi.width = window.innerWidth - 400 - 4;
vi.height = window.innerHeight - 80 - 60 - 4;
vi.margin = 0;
})
},
再者设置video标签的浮动即可,这里有一个bug,最开始我设置的是包含video标签的div浮动,这里会产生div 与 video之间会有间隔,所以只能设置video标签的浮动
overflow: hidden;
background-color: aquamarine;
.video-content-1 {
//float: left; //不能设置div的浮动,会在video之间产生间隔
display:inline;
video {
float: left;
// width: 1520px - 4px;
// height: 849px - 60px;
margin: 2px;
padding: 0;
object-fit: fill;
border-width: 2px;
border-color: aqua;
box-sizing: border-box;
}
}
边栏推荐
- 为租客提供帮助
- “新红旗杯”桌面应用创意大赛2022
- 2022 examination questions and online simulation examination for safety production management personnel of hazardous chemical production units
- Sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]
- Cmu15445 (fall 2019) project 2 - hash table details
- Leetcode skimming: binary tree 27 (delete nodes in the binary search tree)
- ClickHouse(03)ClickHouse怎么安装和部署
- How to reset Firefox browser
- Analysis of DHCP dynamic host setting protocol
- Creation and assignment of graphic objects
猜你喜欢

About the problem of APP flash back after appium starts the app - (solved)

Session

自定义线程池拒绝策略

HZOJ #240. 图形打印四

为租客提供帮助
![[untitled]](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)
[untitled]

【Presto Profile系列】Timeline使用

智云健康上市:市值150亿港元 SIG经纬与京新基金是股东

Smart cloud health listed: with a market value of HK $15billion, SIG Jingwei and Jingxin fund are shareholders

【学习笔记】zkw 线段树
随机推荐
Unity 构建错误:当前上下文中不存在名称“EditorUtility”
【Presto Profile系列】Timeline使用
CMU15445 (Fall 2019) 之 Project#2 - Hash Table 详解
Query whether a field has an index with MySQL
xshell评估期已过怎么办
@Resource和@Autowired的区别?
Unity build error: the name "editorutility" does not exist in the current context
MySQL导入SQL文件及常用命令
红杉中国完成新一期90亿美元基金募集
【无标题】
Guangzhou held work safety conference
File operation command
How to reset Firefox browser
ORACLE进阶(五)SCHEMA解惑
Leetcode brush question: binary tree 24 (the nearest common ancestor of binary tree)
如何让electorn打开的新窗口在window任务栏上面
Grep of three swordsmen in text processing
PACP学习笔记三:PCAP方法说明
DrawerLayout禁止侧滑显示
2022 polymerization process test question simulation test question bank and online simulation test