1. 程式人生 > >h5 video切換到橫屏全屏

h5 video切換到橫屏全屏

其他 height icon -i 技術 nth body ima transform

將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切換到橫屏全屏