博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
css模仿微信弹出菜单
阅读量:7282 次
发布时间:2019-06-30

本文共 3065 字,大约阅读时间需要 10 分钟。

 

css模仿微信弹出菜单 

效果图:

 css模仿微信弹出菜单

html:

选择

  

css:

.action-sheet-backdrop {    -webkit-transition: background-color 150ms ease-in-out;    transition: background-color 150ms ease-in-out;    position: fixed;    top: 0;    left: 0;    z-index: 11;    width: 100%;    height: 100%;    background-color: rgba(0, 0, 0, 0);}  .action-sheet-backdrop.active {    background-color: rgba(0, 0, 0, 0.4);    }  .action-sheet-wrapper {    -webkit-transform: translate3d(0, 100%, 0);    transform: translate3d(0, 100%, 0);    -webkit-transition: all cubic-bezier(0.36, 0.66, 0.04, 1) 500ms;    transition: all cubic-bezier(0.36, 0.66, 0.04, 1) 500ms;    position: absolute;    bottom: 0;    left: 0;    right: 0;    width: 100%;    max-width: 500px;    margin: auto;}  .action-sheet-up {    -webkit-transform: translate3d(0, 0, 0);    transform: translate3d(0, 0, 0);}  .action-sheet {    margin-left: 8px;    margin-right: 8px;    width: auto;    z-index: 11;    overflow: hidden;}  .action-sheet .button {    display: block;    padding: 1px;    width: 100%;    border-radius: 0;    border-color: #d1d3d6;    background-color: transparent;    color: #007aff;    font-size: 21px;}  .action-sheet .button:hover {    color: #007aff;}  .action-sheet .button.destructive {    color: #ff3b30;}  .action-sheet .button.destructive:hover {    color: #ff3b30;}  .action-sheet .button.active,  .action-sheet .button.activated {    box-shadow: none;    border-color: #d1d3d6;    color: #007aff;    background: #e4e5e7;}  .action-sheet-has-icons .icon {    position: absolute;    left: 16px;}  .action-sheet-title {    padding: 16px;    color: #8f8f8f;    text-align: center;    font-size: 13px;}  .action-sheet-group {    margin-bottom: 8px;    border-radius: 4px;    background-color: #fff;    overflow: hidden;}  .action-sheet-group .button {    border-width: 1px 0px 0px 0px;}  .action-sheet-group .button:first-child:last-child {    border-width: 0;}  .action-sheet-options {    background: #f1f2f3;    max-height: 520px;    overflow-y: auto;}  .action-sheet-cancel .button {    font-weight: 500;}  .action-sheet-open {    pointer-events: none;}  .action-sheet-open.modal-open .modal {    pointer-events: none;}  .action-sheet-open .action-sheet-backdrop {    pointer-events: auto;    z-index: 1111;}  .action-sheet .action-sheet-title, .platform-android .action-sheet .button {    text-align: center;}  .action-sheet-cancel {    display: block;}

  

只需要js控制切换class名。

$("body").click(function(){	$("body").addClass("action-sheet-open");	$(".action-sheet-backdrop").addClass("active");	$(".action-sheet-wrapper").addClass("action-sheet-up")})$(".button").click(function(event){	$("body").removeClass("action-sheet-open");	$(".action-sheet-backdrop").removeClass("active");	$(".action-sheet-wrapper").removeClass("action-sheet-up")	event.stopPropagation( );})

  

  

最终的效果图为:

 

转载于:https://www.cnblogs.com/momozjm/p/7657021.html

你可能感兴趣的文章
Python全栈--6.1-match-search-findall-group(s)的区别以及计算器实例
查看>>
基本概念
查看>>
《Linux内核设计与实现》读书笔记(10)--- 定时器和时间管理(2)
查看>>
Spark On YARN内存分配
查看>>
Python学习笔记【第十三篇】:Python网络编程一Socket基础
查看>>
Hibernate ORM框架——项目一:Hibernate查询;项目二:集合相关查询
查看>>
Ionic2开发环境搭建
查看>>
ccf 最优灌溉
查看>>
(30)批处理文件.bat
查看>>
基于MFC和opencv的FFT
查看>>
0823模拟赛
查看>>
Ajax
查看>>
HDU 1849 Rabbit and Grass 【Nim博弈】
查看>>
JMeter-Java压力测试工具-01
查看>>
搜狐在线笔试 时间复杂度O(n)实现数组A[n]中所有元素循环左移k个位置
查看>>
写python时加入缩进设置
查看>>
ubuntu下安装opencv 2.4.9 脚本,支持摄像头和cuda
查看>>
Tensorflow 线性回归预测房价实例
查看>>
UBUNTU tftp 配置
查看>>
利用runtime给系统类添加动态属性
查看>>