zoukankan      html  css  js  c++  java
  • css3 menu 手机菜单3

    首先看一下效果图;

     

    效果1,主要是 scale(0) -->scale(1px);opacity:0;—>opacity: 1; 然后递归延迟 怕麻烦也可以自己写个for循环

    .five b {transform: scale(0); opacity: 0;}
    .five:hover b {transform: scale(1);  opacity: 1; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);}
    .five i {transform: scale(0); opacity: 0;}
    .five:hover i {transform: scale(1);  opacity: 1; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);}

    效果2,主要是 scale(1.5) -->scale(1px);opacity:0;—>opacity: 1;自己弄个cubic-bezier(0.175, 0.885, 0.32, 1.275);类似弹簧

    .six a {transform: scale(1.5); opacity: 0;}
    .six:hover a {transform: scale(1);  opacity: 1; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);}
     
    以下是源代码:
    <!doctype html>
    <html lang="zh">
    <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>CSS3侧边栏菜单3</title>	
    <style type="text/css">
     @import url(http://libs.useso.com/js/font-awesome/4.0.1/css/font-awesome.min.css);
     @import url(http://fonts.useso.com/css?family=Montserrat);
    		* {margin: 0; padding: 0;}
    		 ul,li {list-style-type: none;}
              
    		 h1{1450px;margin: 0 auto; height:80px; line-height:80px;} 
    		  
    		.grid {1500px;margin: 0 auto;}
    		.grid > li { 320px; height: 480px; overflow: hidden; float: left; margin: 20px 0 20px 30px; position: relative; }
    		.grid > li:hover {box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.5);}
    
    		.grid>li section {position: relative; transition: all 0.25s; 320px; height:480px;}
    		.grid>li h2 {font: bold 14px montserrat; color: #eeeeee; text-transform: uppercase; position: absolute; text-align: center;  60%; left: 20%; top:48px; padding: 10px 0; border:1px solid white; border-radius: 4px;}
    
    		.sidenav { position: absolute; top: 0; left: 0; bottom: 0; background: linear-gradient(rgba(50,60,60, 1), rgba(50,60,60, 0.7));  50px; transition: all 0.25s; overflow: hidden; padding-top: 100px;}
    		.sidenav li { _overflow: hidden;  150px; }
            .sidenav a { text-decoration: none; color: #eee;  display: block; line-height: 48px;  }
    		.sidenav span {display: block;}
    		.sidenav b { padding-left 10px; display: block; color: white; font-family: Montserrat; font-size: 12px; line-height: 4; opacity: 0; }
    		.sidenav a i { display: block; float: left; font-size: 16px; line-height: 48px;  50px; text-align: center; }
    
    		/*All instances*/
    		section{ background:url(../../../images/TaylorSwift.jpg) no-repeat #333 center center /contain;  height:500px;}
    		.grid>li:hover .sidenav { 150px;}
    		.grid>li:hover section {margin-left: 150px;  
    							   -webkit-filter: blur(1px); /* Chrome, Opera */
    								 -moz-filter: blur(1px);/*火狐需要svg 实现*/
    								  -ms-filter: blur(1px);    
    									  filter: blur(1px);}
    		.grid>li:hover b {opacity: 1;}
    
    		.sidenav li:nth-child(1) b, .sidenav li:nth-child(1) a {transition-delay: .08s;}
    		.sidenav li:nth-child(2) b, .sidenav li:nth-child(2) a {transition-delay: .16s;}
    		.sidenav li:nth-child(3) b, .sidenav li:nth-child(3) a {transition-delay: .24s;}
    		.sidenav li:nth-child(4) b, .sidenav li:nth-child(4) a {transition-delay: .32s;}
    		.sidenav li:nth-child(5) b, .sidenav li:nth-child(5) a {transition-delay: .40s;}
    		.sidenav li:nth-child(6) b, .sidenav li:nth-child(6) a {transition-delay: .48s;}
    
    		/*Five*/
    		.five b {transform: scale(0); opacity: 0;}
    		.five:hover b {transform: scale(1);  opacity: 1; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);}
    		.five i {transform: scale(0); opacity: 0;}
    		.five:hover i {transform: scale(1);  opacity: 1; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);}
    
    		.sidenav li:nth-child(1) i {transition-delay: .48s;}
    		.sidenav li:nth-child(2) i {transition-delay: .40s;}
    		.sidenav li:nth-child(3) i {transition-delay: .32s;}
    		.sidenav li:nth-child(4) i {transition-delay: .24s;}
    		.sidenav li:nth-child(5) i {transition-delay: .16s;}
    		.sidenav li:nth-child(6) i {transition-delay: .08s;}
    
    		/*Six*/
    		.six a {transform: scale(1.5); opacity: 0;}
    		.six:hover a {transform: scale(1);  opacity: 1; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);}
    	</style>
    	<!--[if IE]>
    		<script src="http://libs.useso.com/js/html5shiv/3.7/html5shiv.min.js"></script>
    	<![endif]-->
    </head>
    <body>
    	      <h1>利用 scale </h1>
    		<ul class="grid">
    			<li class="five">
    				<ul class="sidenav">
    					<li><a><i class="fa fa-check"></i><b>由小放小</b></a></li>
    					<li><a><i class="fa fa-inbox"></i><b>Messages</b></a></li>
    					<li><a><i class="fa fa-pencil"></i><b>New Post</b></a></li>
    					<li><a><i class="fa fa-cog"></i><b>Settings</b></a></li>
    					<li><a><i class="fa fa-star"></i><b>Starred</b></a></li>
    					<li><a><i class="fa fa-power-off"></i><b>Logout</b></a></li>
    				</ul>
    				<section><h2>Ripple Effect</h2></section>
    			</li>
    			<li class="six">
    				<ul class="sidenav">
    					<li><a><i class="fa fa-check"></i><b>由大缩小</b></a></li>
    					<li><a><i class="fa fa-inbox"></i><b>Messages</b></a></li>
    					<li><a><i class="fa fa-pencil"></i><b>New Post</b></a></li>
    					<li><a><i class="fa fa-cog"></i><b>Settings</b></a></li>
    					<li><a><i class="fa fa-star"></i><b>Starred</b></a></li>
    					<li><a><i class="fa fa-power-off"></i><b>Logout</b></a></li>
    				</ul>
    				<section><h2>Scroll Down</h2></section>
    			</li>
    		</ul>
    	
    </body>
    </html>
  • 相关阅读:
    微信二维码 场景二维码 用于推送事件,关注等 注册用户 ,经过测试
    简单的 Helper 封装 -- CookieHelper
    简单的 Helper 封装 -- SecurityHelper 安全助手:封装加密算法(MD5、SHA、HMAC、DES、RSA)
    Java反射机制
    Windows Azure Web Site (13) Azure Web Site备份
    Windows Azure Virtual Machine (1) IaaS用户手册
    Windows Azure Web Site (1) 用户手册
    Windows Azure Web Site (12) Azure Web Site配置文件
    Windows Azure Web Site (11) 使用源代码管理器管理Azure Web Site
    Windows Azure Web Site (10) Web Site测试环境
  • 原文地址:https://www.cnblogs.com/surfaces/p/4347369.html
Copyright © 2011-2022 走看看