css3实现手机菜单展开收起动画
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Examples</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="" rel="stylesheet">
<script type="text/javascript" src="jquery.js"></script>
</head>
<style type="text/css">
.test {
margin: 500px auto;
text-align: center;
width: 100px;
height: 100px;
}
.test button {
height: 100px;
background: none;
outline: none;
cursor: pointer;
border: none; }
.test span {
width: 100px;
height: 10px;
background: red;
position: relative;
display: block;
border-radius: 10px;
transition: background .3s .2s ;
/*激活之后 ,前面的秒数是动画消耗的时间,后面的秒数是推迟开始的时间*/
}
.test span:before {
content: "";
display: block;
top: -30px;
left: 0;
width: 100px;
height: 10px;
background: red;
position: absolute;
border-radius: 10px;
transition: top .3s .2s ease, -webkit-transform .3s ease;
}
.test span:after {
content: "";
background: red;
display: block;
width: 100px;
height: 10px;
top: 30px;
position: absolute;
left: 0;
border-radius: 10px;
transition: top .3s .2s ease, -webkit-transform .3s ease;
}
.test button.active span {
background: transparent;
border-radius: 10px;
-webkit-transform-origin: 50% 50%;
transition: background .2s .1s ease;
/*激活之前 ,前面的秒数是动画消耗的时间,后面的秒数是推迟开始的时间*/
}
.test button.active span:before {
transform: rotate(45deg);
top: 0;
transition: top .3s ease, -webkit-transform .3s .2s ease;
}
.test button.active span:after {
transform: rotate(-45deg);
top: 0;
transition: top .3s ease, -webkit-transform .3s .2s ease; }
</style>
<body>
<div class="test">
<button>
<span></span>
</button>
</div>
</body>
</html>
<script type="text/javascript">
//自定义开关
var _a = true;
$("button").click(function(){
if(_a == true){
$(this).addClass("active");
_a= false;
}else{
$(this).removeClass("active");
_a= true;
}
})
</script>
css3实现手机菜单展开收起动画的更多相关文章
- vue.js 实现点击展开收起动画
最近公司项目加了个页面,其中要求是这样的,点击对应列表,展开和收起, 其实就是显示和隐藏内容部分:说来惭愧,我花了半天时间才搞出来(自黑一下~), ,,接下来分享给大家,先上效果图: .vue页面: ...
- css3 menu 手机菜单3
首先看一下效果图; 效果1,主要是 scale(0) -->scale(1px);opacity:0;—>opacity: 1; 然后递归延迟 怕麻烦也可以自己写个for循环 .five ...
- css3 menu 手机菜单1
首先看一下效果图; 效果1,主要是 translateY(100px) -->translateY(0px);opacity:0;—>opacity: 1; 然后递归延迟 怕麻烦也可以自己 ...
- jQuery手机菜单
效果展示 http://hovertree.com/texiao/nav/4/ 手机扫描二维码查看效果: 源码下载 http://hovertree.com/h/bjaf/kroft6c7.htm ...
- jQuery鼠标悬停3d菜单展开动画
效果体验:http://hovertree.com/texiao/jquery/93/ 竖直的主菜单贴着页面左侧,当光标移入菜单项时,以3D动画的方式弹出对应的二级菜单.采用jQuery和CSS3实现 ...
- 多种css3时尚侧栏菜单展开显示效果Off-Canvas Menu Effects
今天我们想分享多种css3时尚侧栏菜单展开显示效果.侧边栏应用广泛,我们之前已经产生了一些效果灵感.风格演变,今天我们要展示一套新的灵感的现代效果.不同的布局和菜单的同步转换和页面可以让一切看起来更有 ...
- 纯css3开发的响应式设计动画菜单(支持ie8)
这是一个响应式设计的菜单.单击列表图标,当你显示屏大小可以完全水平放下所有菜单项时,菜单水平显示(如图1).当你的显示屏不能水平放置所有菜单项时,菜单垂直显示(如图2). 而且显示的时候是以动画的型式 ...
- [TimLinux] CSS 纯CSS实现动画展开/收起功能
内容转自CSS世界,理解之后进行了简化,简化后代码: <!DOCTYPE html> <html> <head> <meta charset=utf-8 /& ...
- javasript简单实现文字的展开收起(无动画)
今天在工作遇到展开和收起的需求,在网上找了很多方法,今天来写一下我觉得比较简单的方法 在项目中需要达到如图这种效果 首先想的是使用overflow简单且粗暴,在需要展开的的文字定义样式 { overf ...
随机推荐
- Nginx Configure时配置
Configure Arguments Configure arguments common for nginx binaries from pre-built packages for stable ...
- Oracle start with connect by prior 用法
Oracle start with connect by prior 用法 语法: select * from 表名 where 条件1 start with 条件2 connect by pr ...
- hdu1520 第一道树形DP,激动哇咔咔!
A - 树形dp Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Sta ...
- poj3579 二分搜索+二分查找
Median Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5468 Accepted: 1762 Descriptio ...
- linux服务器wget无法成功解析域名及程序获取外网数据不稳定问题
1.问题描述: 1.1 最近发现通过linux服务器wget下载远程文件经常提示无法解析域名问题,要重复多次才能成功,成功率比较低. 1.2 PHP用file_get_contents()函数获取淘宝 ...
- 继续畅通工程--hdu1879
继续畅通工程 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Subm ...
- SQLServer中数据库文件的存放方式,文件和文件组
我们公司近一年来做了一个CRM系统. 遇到一个问题就是:在插入交流记录的时候速度特别慢.(交流记录数据量大) 后来我们经理采用文件组的方法,将客户交流记录这张表提出来就快很多了 这里有一篇关于文件组的 ...
- HTTP 协议简介
HTTP 协议简介 博客分类: acl开发--HTTP协议篇 网络协议http协议 一.TCP/IP 协议介绍 在介绍 HTTP 协议之前,先简单说一下TCP/IP协议的相关内容.TCP/IP协议是 ...
- 几种TCP连接中出现RST的情况
http://blog.chinaunix.net/uid-24517549-id-3991141.html http://blog.chinaunix.net/uid-24517549-id-399 ...
- LeetCode_Word Ladder
Given two words (start and end), and a dictionary, find the length of shortest transformation sequen ...