当前位置:网站首页>分屏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;
}
}
边栏推荐
- [untitled]
- 自定义线程池拒绝策略
- MySQL master-slave replication
- 非分区表转换成分区表以及注意事项
- API query interface for free mobile phone number ownership
- Blog recommendation | Apache pulsar cross regional replication scheme selection practice
- PACP学习笔记三:PCAP方法说明
- Day26 IP query items
- PHP calls the pure IP database to return the specific address
- Conversion from non partitioned table to partitioned table and precautions
猜你喜欢
日本政企员工喝醉丢失46万信息U盘,公开道歉又透露密码规则
Leetcode skimming: binary tree 23 (mode in binary search tree)
. Net ultimate productivity of efcore sub table sub database fully automated migration codefirst
Isprs2021/ remote sensing image cloud detection: a geographic information driven method and a new large-scale remote sensing cloud / snow detection data set
Blog recommendation | Apache pulsar cross regional replication scheme selection practice
【学习笔记】AGC010
Leetcode skimming: binary tree 20 (search in binary search tree)
线程池拒绝策略最佳实践
Visual stdio 2017 about the environment configuration of opencv4.1
HZOJ #240. 图形打印四
随机推荐
博文推荐|Apache Pulsar 跨地域复制方案选型实践
线程池拒绝策略最佳实践
Differences between MySQL storage engine MyISAM and InnoDB
HZOJ #240. Graphic printing IV
Leetcode brush question: binary tree 24 (the nearest common ancestor of binary tree)
Initialization script
Sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]
滑轨步进电机调试(全国海洋航行器大赛)(STM32主控)
Talk about four cluster schemes of redis cache, and their advantages and disadvantages
详细介绍六种开源协议(程序员须知)
How does MySQL create, delete, and view indexes?
2022 examination questions and online simulation examination for safety production management personnel of hazardous chemical production units
Test next summary
通过Keil如何查看MCU的RAM与ROM使用情况
Cookie and session comparison
2022 polymerization process test question simulation test question bank and online simulation test
[untitled]
【学习笔记】线段树选做
Enterprise custom form engine solution (XII) -- experience code directory structure
TPG x AIDU|AI领军人才招募计划进行中!