zoukankan      html  css  js  c++  java
  • css3 钟表

    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>无标题文档</title>
    <style id= "css">
    #wrap{
    	200px;height: 200px;position: relative;border-radius: 50%;
    	border:1px solid black;margin: 100px auto;
    }
    #wrap ul{
    	margin:0px;padding: 0px;height: 200px;list-style: none;position: relative;
    }
    #wrap ul li {
    	 2px; height: 6px; background: black;position: absolute;left: 98px;top: 0px; -webkit-transform-origin:center 100px;
    }
    #wrap ul li:nth-of-type(5n+1){height:10px;background:#000;}
    #hour{
    	 6px;height: 45px;background: #000;position: absolute; left: 97px;top: 55px;-webkit-transform-origin:bottom;
    }
    #min{
    	 4px;height: 65px;background: #999;position: absolute; left: 98px;top: 35px;-webkit-transform-origin:bottom;
    }
    #sec{
    	 2px;height: 80px;background: red;position: absolute; left: 99px;top: 20px;-webkit-transform-origin:bottom;
    }
    #icon{
    	10px;height: 10px;background: #000;position:absolute;border-radius: 50%;left: 95px;top:95px;
    }
    </style>
    <script>
    	window.onload = function (){
    		var oList = document.getElementById("list");
    		var aLi = "";
    		var oHour = document.getElementById("hour");
    		var oMin = document.getElementById("min");
    		var oSec = document.getElementById("sec");
    		for(var i = 0; i < 60; i++)
    		{
    			
    			aLi +="<li style='-webkit-transform:rotate("+6*i+"deg)'></li>";
    
    		}
    		oList.innerHTML = aLi;
    		setInterval( function(){
    			toTime(oHour,oMin,oSec);
    		},1000);
    	
    
    		function toTime(oHour,oMin,oSec)
    		{
    			var oDate=new Date();
    			var iSec=oDate.getSeconds();
    			var iMin=oDate.getMinutes()+iSec/60;
    			var iHour=(oDate.getHours()%12)+iMin/60;
    			oSec.style.WebkitTransform="rotate("+(iSec*360/60)+"deg)";
    			oMin.style.WebkitTransform="rotate("+(iMin*360/60)+"deg)";
    			oHour.style.WebkitTransform="rotate("+(iHour*360/12)+"deg)";
    		}
    
    	}
    </script>
    </head>
    	<body>
    		<div id = "wrap">
    			<ul id = "list">
    			</ul
    		</div>
    		<div id="hour"></div>
    		<div id="min"></div>
    		<div id="sec"></div>
    		<div id="icon"></div>
    	</body>
    </html>
    

      

  • 相关阅读:
    Java并发之ThreadPoolExecutor
    Java并发之同步工具类
    em和i , b和Strong 的区别
    OS应用架构谈(二):View层的组织和调用方案(中)
    iOS应用架构谈(二):View层的组织和调用方案(上)
    java(List或Array数组)求交集、并集、差集, 泛型工具类
    AES/DES 可逆性加密算法 -- java工具类
    用xtrabackup实现mysql的主从复制 阿里云rds到自己创建mysql
    java 生成二维码工具
    XDU 1022 (数论筛法+前缀和)
  • 原文地址:https://www.cnblogs.com/mayufo/p/4396543.html
Copyright © 2011-2022 走看看