弹窗层从下往上效果

<!DOCTYPE html>

<html lang="zh">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">

<title>trans</title>

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js" type="text/javascript"></script>

<style>

*{

margin: 0;

padding: 0;

border: none;

}

html,body{

width: 100%;

height: 100%;

}

#wrap{

width: 100%;

height: 100%;

}

.box{

width: 100%;

height: 100%;

background: red;

}

.box button{

width: 50%;

height: 50%;

}

.popup{

}

.mask{

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

position: fixed;

bottom: 0;

left: 0;

top: 0;

right: 0;

opacity: 0;

will-change: opacity;

transition: all 0.5s;

visibility: hidden;

}

/*.content{

position: absolute;

bottom: 0;

left: 0;

right: 0;

height: 80%;

background: white;

transform: translate(0,100%);

transition: transform 0.5s;

}*/

.content{

position: absolute;

left: 0;

right: 0;

bottom: 0;

top: 20%;

background-color: #fff;

-webkit-transform: translate3d(0,100%,0);

transform: translate3d(0,100%,0);

will-change: transform;

box-shadow: 0 -1px 40px rgba(0,0,0,.3);

-webkit-transition: -webkit-transform .3s cubic-bezier(0,0,.25,1) 80ms;

transition: transform .3s cubic-bezier(0,0,.25,1) 80ms;

}

.opacity1{

pointer-events: auto;

opacity: 1;

}

.maskpop{

pointer-events: auto;

opacity: 1;

visibility: visible;

/*background-color: rgba(0,0,0,.5);*/

}

.trans{

-webkit-transform: translate3d(0,0,0);

transform: translate3d(0,0,0);

}

</style>

</head>

<body>

<div id="wrap">

<div class="box">

<button @click="popup">点我</button>

</div>

<div class="popup">

<div class="mask" :class="{'maskpop':isShow}">1</div>

<div class="content" :class="{'trans':isShow}">

<button @click="pophide">电我</button>

</div>

</div>

</div>

</body>

<script>

var vm = new Vue({

el:"#wrap",

data:{

isShow:false

},

methods:{

popup:function () {

this.isShow = true;

console.log(1);

},

pophide:function () {

this.isShow = false;

console.log(2);

}

}

})

</script>

</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值