html5视频遮罩,Day07(HTML5 demo 视频,遮罩)

视频

播放暂停

var video = document.getElementById("video");

var bf = document.getElementById("btn1");

var zt = document.getElementById("btn2");

bf.οnclick=function(){

video.play();

}

zt.οnclick=function(){

video.pause();

}

var flag = true;

video.οnclick=function(){

if(flag){

this.play();

flag = false;

}else{

this.pause();

flag = true;

}

}

视频遮罩

*{margin: 0;padding: 0;}

html{

height: 100%;

}

body{

overflow: hidden;

height: 100%;

}

.main{

height: 100%;

width: 100%;

position: relative;

display: block;

}

.lop{

width: 100%;

height: 100%;

position: absolute;

z-index: 10;

background: rgba(0,0,0,0.4);

top: 0;

left: 0;

}

.vd{

position: absolute;

z-index: 1;

top: 0;

left: 0;

}

.btn{

height: 0px;

width: 0px;

border: 25px solid #efefef;

border-right-color: transparent;

border-top-color: transparent;

border-bottom-color: transparent;

position: absolute;

top: 45%;

left: 50%;

margin-left: -25px;

cursor: pointer;

z-index: 15;

}

.but{

height: 100px;

width: 100px;

background: rgba(0,0,0,.5);

font-size: 80px;

position: absolute;

z-index: 50;

right: 30px;

top: 30px;

}

.vp{

position: absolute;

z-index: 20;

}

.nav{

display: none;

}

$('.btn').on('click',function(){

$('#vd')[0].pause();

$('.main').css('display','none');

$('.nav').css('display','block');

$('.vp')[0].play();

});

$('.but').on('click',function(){

$('.vp')[0].pause();

$('.nav').css('display','none');

$('.main').css('display','block');

$('#vd')[0].play();

});

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值