当前位置:网站首页>分屏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;
}
}
边栏推荐
- 2022a special equipment related management (boiler, pressure vessel and pressure pipeline) simulated examination question bank simulated examination platform operation
- Leetcode skimming: binary tree 20 (search in binary search tree)
- .Net下极限生产力之efcore分表分库全自动化迁移CodeFirst
- Leetcode skimming: binary tree 25 (the nearest common ancestor of binary search tree)
- About the problem of APP flash back after appium starts the app - (solved)
- Star Enterprise Purdue technology layoffs: Tencent Sequoia was a shareholder who raised more than 1billion
- Image pixel read / write operation
- Users, groups, and permissions
- Coscon'22 community convening order is coming! Open the world, invite all communities to embrace open source and open a new world~
- Ip2long and long2ip analysis
猜你喜欢

人均瑞数系列,瑞数 4 代 JS 逆向分析

达晨与小米投的凌云光上市:市值153亿 为机器植入眼睛和大脑

Sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]

Differences between MySQL storage engine MyISAM and InnoDB

飞桨EasyDL实操范例:工业零件划痕自动识别

2022 practice questions and mock examination of the third batch of Guangdong Provincial Safety Officer a certificate (main person in charge)

.Net下極限生產力之efcore分錶分庫全自動化遷移CodeFirst

【无标题】

Leetcode question brushing: binary tree 26 (insertion operation in binary search tree)

Talk about four cluster schemes of redis cache, and their advantages and disadvantages
随机推荐
[learn microservice from 0] [01] what is microservice
@Resource和@Autowired的区别?
. Net ultimate productivity of efcore sub table sub database fully automated migration codefirst
Adopt a cow to sprint A shares: it plans to raise 1.85 billion yuan, and Xu Xiaobo holds nearly 40%
飞桨EasyDL实操范例:工业零件划痕自动识别
regular expression
Practical example of propeller easydl: automatic scratch recognition of industrial parts
test
HZOJ #236. Recursive implementation of combinatorial enumeration
[difficult and miscellaneous]pip running suddenly appears modulenotfounderror: no module named 'pip‘
COSCon'22 社区召集令来啦!Open the World,邀请所有社区一起拥抱开源,打开新世界~
.Net下极限生产力之efcore分表分库全自动化迁移CodeFirst
人均瑞数系列,瑞数 4 代 JS 逆向分析
【无标题】
环境配置篇
【Presto Profile系列】Timeline使用
API query interface for free mobile phone number ownership
Leetcode brush question: binary tree 24 (the nearest common ancestor of binary tree)
Practical case: using MYCAT to realize read-write separation of MySQL
leecode3. 无重复字符的最长子串