zoukankan      html  css  js  c++  java
  • 微信小程序下拉动画

    wxml

    <view class="content-container">
      <view class="pick-header" bindtap="onPickHeaderClick">
        筛选pick-header view z-index:60
      </view>
    
      <view class="pick-container {{needAnimation ? (openPicker ? 'slidown' : 'slidup') : ''}}">
        筛选项 pick-container view z-index:50
      </view>
    </view>

    wxss

    .content-container {
     100%;
    position: absolute;
    }
    
    /*筛选头部*/
    .pick-header {
       100%;
      height: 72rpx;
      z-index: 60;
      position: fixed;
     background-color: lightcoral;
    }
    
    /*筛选项容器布局*/
    .pick-container {
       100%;
      height: 300rpx;
      background-color: lightgoldenrodyellow;
      position: absolute;
      z-index: 50;
      top: -228rpx;
    }
    
    /*筛选项隐藏 显示动画 start*/
    @keyframes slidown {
      from {
        transform: translateY(0%);
      }
    
      to {
        transform: translateY(100%);
      }
    }
    
    .slidown {
      display: block;
      animation: slidown 0.1s ease-in both;
    }
    
    @keyframes slidup {
      from {
        transform: translateY(100%);
      }
    
      to {
        transform: translateY(0%);
      }
    }
    
    .slidup {
      display: block;
      animation: slidup 0.2s ease-in both;
    }
    /*筛选项隐藏 显示动画 end*/

    js

    Page({
      data: {
        openPicker: false,
        needAnimation: false,
        contentHeight: 0
      },
    
      onLoad: function () {
    
      },
      onPickHeaderClick: function () {
        this.setData({
          openPicker: !this.data.openPicker,
          needAnimation: true
        })
      },
    })
  • 相关阅读:
    ⑥nginx location
    ③nginx 多虚拟主机配置
    ①nginx 安装简介
    11.ansible 角色
    10.ansible 标签功能 触发功能 忽略远程主机采集
    9.ansible 循环功能和忽略错误
    8.ansible 判断功能
    7.ansible在剧本中注册信息
    6.ansible变量
    5.ansible 剧本编写规范
  • 原文地址:https://www.cnblogs.com/chenmiaosong/p/9261696.html
Copyright © 2011-2022 走看看