zoukankan      html  css  js  c++  java
  • css3 监听webkitAnimationEnd运动结束 后执行什么

    <!DOCTYPE html>
    <html>
    	<head>
    		<meta charset="UTF-8">
    		<title></title>
    		<style type="text/css">
    			*{
    				margin: 0;
    				padding: 0;
    			}
    			
    			#box{
    				position: relative;
    				/*overflow: hidden;*/
    				margin: 0 auto;
    				 1000px;
    				height: 500px;
    				border: 1px solid black;
    				transform: scaleX(0) scaleY(0);
    			}
    			#box #inner{
    				position: absolute;
    				left: 0;
    				top: 0;
    				right: 0;
    				bottom: 0;
    				margin: auto;
    				 400px;
    				height: 400px;
    				opacity: 0;
    				transform: rotate(0deg) scale(0.5);
    				font-size: 100px;
    				line-height: 400px;
    				text-align: center;
    				color: white;
    				background: red;
    				border-radius:50% ;
    			}
    			.innerShow{
    				-webkit-animation: fadeIn 0.5s forwards;
    			}
    			@-webkit-keyframes scaleIn{
    				0%{
    					transform:scaleX(0) scaleY(0);
    				}
    				25%{
    					transform: scaleX(0) scaleY(0.5);
    				}
    				50%{
    					transform: scaleX(1) scaleY(0.5);
    				}
    				100%{
    					transform: scaleX(1) scaleY(1);
    				}
    			}
    			@-webkit-keyframes fadeIn{
    				from{opacity: 0;}
    				to{opacity: 1;}
    			}
    			@-webkit-keyframes rotateScale{
    				from{
    					transform:rotate(0deg) scale(0.5);
    				}
    				to{
    					transform:rotate(360deg) scale(1);
    				}
    			}
    		</style>
    	</head>
    	<body>
    		<input id="btn" type="button" name="" id="" value="按钮" />
    		
    		<div id="box">
    			<div id="inner">HTML5</div>
    		</div>
    		
    		<script>
    			var oBtn = document.getElementById("btn");
    			var oBox = document.getElementById("box");
    			var oInner = document.getElementById('inner');
    			
    			
    			oBtn.onclick = function(){
    				oBox.style.webkitAnimation = "scaleIn 1s ease forwards";
    			}
    			
    			oBox.addEventListener("webkitAnimationEnd",function(){
    				oInner.className = "innerShow";
    				
    				
    			},false);
    			
    			oInner.addEventListener("webkitAnimationEnd",function(){
    				oInner.style.opacity =1;
    				oInner.style.webkitAnimation = "rotateScale 1s forwards";
    			},false);
    		</script>
    	</body>
    </html>
    

      

  • 相关阅读:
    找正环的最快方法!!
    树重量的神仙问题
    2019 ICPC南昌网络赛 B题
    洛谷p-1522又是Floyd
    poj3471
    洛谷p1119--灾难后重建(Floyd不仅仅是板子)
    并查集的超市问题---溜TM的
    利用主席树 搞区间不同值的和
    acwing 102 -利用二分枚举区间平均值
    Week__8
  • 原文地址:https://www.cnblogs.com/mingjixiaohui/p/5388816.html
Copyright © 2011-2022 走看看