H5上的ActionForm

方式一:遮罩层和ActionForm分开

<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<style>
    .mask{
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        opacity: 0;
        visibility: hidden;
        -webkit-transition-duration: 0.3s;
        transition-duration: 0.3s;
        background: rgba(0,0,0,0.6);
        transition-duration: 0.3s;
        z-index: 9999;
    }

    .mask-visible{
        opacity: 1;
        visibility: visible;
    }

    .action-form{
        position: fixed;
        left: 0;
        bottom: 0;
        -webkit-transform: translateY(100%);
        transform: translateY(100%);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        z-index: 10000;
        width: 100%;
        background-color: #efeff4;
        -webkit-transition: -webkit-transform 0.3s;
        transition: -webkit-transform 0.3s;
        transition: transform 0.3s;
        transition: transform 0.3s,-webkit-transform 0.3s;
    }

    .action-form-visible{
        -webkit-transform: translate(0);
        transform: translate(0);
    }
</style>
<body>
    <div>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
    </div>
    <div>
        <div class="mask mask-visible"></div>
        <div class="action-form action-form-visible">
            <input type="text"></input><button>我是按钮</button><br>
            <input type="text"></input><button>我是按钮</button><br>
            <input type="text"></input><button>我是按钮</button><br>
            <input type="text"></input><button>我是按钮</button><br>
            <input type="text"></input><button>我是按钮</button><br>
            <input type="text"></input><button>我是按钮</button><br>
        </div>
    </div>
</body>
</html>
复制代码

方式二:ActionForm嵌入到遮罩层里面

<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<style>
    .action-form-mask{
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        bottom: 0;
        opacity: 0;
        visibility: hidden;
        background: rgba(0,0,0,0.6);
        -webkit-transition-duration: 0.3s;
        transition-duration: 0.3s;
        transition-duration: 0.3s;
        z-index: 9999;
    }

    .action-form-mask-visible{
        opacity: 1;
        visibility: visible;
    }

    .action-form{
        position: fixed;
        left: 0;
        bottom: 0;
        z-index: 10000;
        width: 100%;
        background-color: #efeff4;
    }
</style>
<body>
    <div>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
        <input type="text"></input><button>我是按钮</button><br>
    </div>
    <div class="action-form-mask action-form-mask-visible">
        <div class="action-form">
            <input type="text"></input><button>我是按钮</button><br>
            <input type="text"></input><button>我是按钮</button><br>
            <input type="text"></input><button>我是按钮</button><br>
            <input type="text"></input><button>我是按钮</button><br>
            <input type="text"></input><button>我是按钮</button><br>
            <input type="text"></input><button>我是按钮</button><br>
        </div>
    </div>
</body>
</html>
复制代码
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值