zoukankan      html  css  js  c++  java
  • [微信小程序]实现一个自定义遮罩层

    正文:

    先上效果图: 点击按钮Show显示遮罩层,再次点击屏幕任何地方隐藏遮罩层;

    <button bindtap="showview">Show</button>
    <view class="bg" bindtap='hideview' style='display:{{display}}'></view>
    <view class="show" bindtap='hideview' style='display:{{display}}'>申请成功
    <view class='txt'>您的密码为:123456</view>
    </view>
    .bg {
      display: none;
      position: absolute;
      top: 0%;
      left: 0%;
      width: 100%;
      height: 100%;
      background-color: black;
      z-index: 1001;
      -moz-opacity: 0.7;
      opacity: 0.70;
      filter: alpha(opacity=70);
    }
     
    .show {
      display: none;
      text-align: center;
      position: absolute;
      top: 45%;
      left: 20%;
      width: 53%;
      height: 10%;
      padding: 8px;
      border: 8px solid #e8e9f7;
      background-color: white;
      z-index: 1002;
      overflow: auto;
    }
    .txt{
      margin-top: 20rpx;
      font-size: 28rpx;
      color: royalblue
    }
    Page({
      data: {
        display:''
      },
      showview: function() { 
        this.setData({
          display: "block"
        })
      },
      hideview: function() {
        this.setData({
          display: "none"
        })
      }
    })

    转: https://blog.csdn.net/qq_35713752/article/details/78675450

  • 相关阅读:
    如何在IDEA中查看Gradle项目的所有依赖关系
    YUYV&YV12&mtk6763
    MTK-shot mode
    Thread中,join()方法
    高通平台常用缩写
    Android.mk用法详解
    HAL层编写规范
    MMU
    Linux设备驱动中断机制
    阻塞和非阻塞I/O
  • 原文地址:https://www.cnblogs.com/fps2tao/p/11290221.html
Copyright © 2011-2022 走看看