zoukankan      html  css  js  c++  java
  • HTML for android 移动小球

    <html>
    <head>
    <title>球</title>
     <style type="text/css">
     .test{
    	100px;
    	height:100px;
    	position:absolute;
    	top:0px;
    	left:0px;
    	background:red;
    	border-radius:50px;
    	
    	transition: left 5s ease-out 5s,
    	background-color 5s ease 0s;
    	-moz-transition:left 5s ease-out 5s,
    	background-color 5s ease 0s;
    	-webkit-transition:left 5s ease-out 5s,
    	background-color 5s ease 0s;
    	-o-transition:left 5s ease-out 5s,
    	background-color 5s ease 0s;
    
    	}
    	
    
     .second-position{
    	left:50%;
    	background-color:yellow;
     }
    
    .ball{
    	20px;
    	height:20px;
    	position:absolute;
    	top:0px;
    	left:0px;
    	background:blue;
    	border-radius:50px;
    	animation:bouncyball 3s ease-in-out;
    	-moz-animation:bouncyball 12s ease-in-out;
    	-webkit-animation:bouncyball 23s ease-in-out;
    	}
    
     @keyframes bouncyball{
    	0%{bottom:100%;left:0px;}
    	12.5%{bottom:0px;left:12.5px;}
    	25%{bottom:50%;left:25%;}
    	50.5%{bottom:0px;left:12.5px;}
    	55%{bottom:24%;left:50%;}
    	62.5%{bottom:0px;left:12.5px;}
    	75%{bottom:12.5;left:75%;}
    	80.5%{bottom:0px;left:12.5px;}
    	100%{bottom:2%;left:100%;}
    	 }
     
     @-moz-keyframes bouncyball{
    		0%{bottom:100%;left:0px;}
    	12.5%{bottom:0px;left:12.5px;}
    	25%{bottom:50%;left:25%;}
    	50.5%{bottom:0px;left:12.5px;}
    	55%{bottom:24%;left:50%;}
    	62.5%{bottom:0px;left:12.5px;}
    	75%{bottom:12.5;left:75%;}
    	80.5%{bottom:0px;left:12.5px;}
    	100%{bottom:2%;left:100%;}
    	 }
     
     @-webkit-keyframes bouncyball{
    		0%{bottom:100%;left:0px;}
    	12.5%{bottom:0px;left:12.5px;}
    	25%{bottom:50%;left:25%;}
    	50.5%{bottom:0px;left:12.5px;}
    	55%{bottom:24%;left:50%;}
    	62.5%{bottom:0px;left:12.5px;}
    	75%{bottom:12.5;left:75%;}
    	80.5%{bottom:0px;left:12.5px;}
    	100%{bottom:2%;left:100%;}
     }
     </style>
    </head> 
    <body>
    <div class="test"></div>
    <script>
    	document.getElementsByClassName('test')[0].classList.add('second-position');
    </script>
    
    <div class="ball"></div>
     
     
    </body>
    
    </html>


  • 相关阅读:
    Codevs P1501二叉树的最大宽度和高度
    react 脚手架使用
    vue 学习七 组件上使用插槽
    vue 学习 cli3常用配置
    vue 学习五 深入了解components(父子组件之间的传值)
    vue 学习四 了解组件
    vue 学习二 深入vue双向绑定原理
    vue 学习一 组件生命周期
    vscode 常用插件
    解决在移动端上 click事件延迟300 毫秒的问题 fastclick.js
  • 原文地址:https://www.cnblogs.com/aikongmeng/p/3697416.html
Copyright © 2011-2022 走看看