码迷,mamicode.com
首页 > 其他好文 > 详细

h5 video切换到横屏全屏

时间:2017-07-21 21:50:49      阅读:2494      评论:0      收藏:0      [点我收藏+]

标签:images   controls   tar   start   transform   idt   index   icon   image   

将video设置为屏幕大小,覆盖其他元素,想到这种操作我也是震惊的

function() {
                let startIcon = document.getElementById(‘start-icon‘);
                startIcon.src = ‘/static/icon/icon-ctrl-stop.png‘;
                let myVideo = document.getElementById(‘myVideo‘);
                myVideo.controls = ‘auto‘;

                let w = document.documentElement.clientWidth || document.body.clientWidth;
                let h = document.documentElement.clientHeight || document.body.clientHeigth;
                let cha = Math.abs(h - w) / 2;
                myVideo.width = h;
                myVideo.height = w;
                myVideo.style.zIndex = 2000;
                myVideo.style.top = 0
                myVideo.style.transform = ‘translate(-‘ + cha + ‘px,‘ + cha + ‘px) rotate(90deg)‘;

            }

 

精灵图点亮星星的这种操作

技术分享

将图片右移一格

技术分享

也是震惊的,以前都改svg图片颜色

h5 video切换到横屏全屏

标签:images   controls   tar   start   transform   idt   index   icon   image   

原文地址:http://www.cnblogs.com/rlann/p/7219615.html

(1)
(1)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!