<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style id= "css">
#wrap{
width: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 {
width: 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{
width: 6px;height: 45px;background: #000;position: absolute; left: 97px;top: 55px;-webkit-transform-origin:bottom;
}
#min{
width: 4px;height: 65px;background: #999;position: absolute; left: 98px;top: 35px;-webkit-transform-origin:bottom;
}
#sec{
width: 2px;height: 80px;background: red;position: absolute; left: 99px;top: 20px;-webkit-transform-origin:bottom;
}
#icon{
width: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>

  

css3 钟表的更多相关文章

  1. css3时钟

    参考资料: 奇舞团: http://www.75team.com/archives/851 DEMO:demo 截图: 代码: <!DOCTYPE html> <html lang= ...

  2. 太可爱了!CSS3 & SVG 制作的米老鼠钟表

    米老鼠是大家非常熟悉的迪斯尼动画形象.这是一个可爱的效果,结合 CSS & SVG 图形实现的米老鼠钟表效果.Web 技术让很多生活中的事物都能搬到网上去,后面的推荐阅读也有很多的效果,感兴趣 ...

  3. 【原】CSS3的3D动画 ——3D旋转之骰子样式的钟表(2)下.md

    之前看到智能社主页的那个骰子样式的钟表,最近研究了一下,虽然没有仔细看他是怎么做的,但是学了css3的动画之后想自己尝试着写一下,用到的原理可能和智能社网站的不太一样,我自己主要用到了css3和js. ...

  4. 15款HTML5/CSS3案例展示,导航,日历,钟表。

    对于前端开发者来说,分享一些优秀的HTML5应用可以直接拿来用,更重要的是可以激发创作的灵感.今天我们要分享9款精挑细选的HTML5应用,个个都是干货. 1.HTML5/CSS3滑块动画菜单 图标动画 ...

  5. 用css3+js写了一个钟表

    有一天看到css3旋转这个属性,突发奇想的写了一个钟表(没做浏览器兼容),来一起看看是怎么写的吧! 先给个成品图,最终结果是个样子的(动态的). 首先,思考了一下页面的布局,大致需要4层div,最底层 ...

  6. css3实现钟表效果

    利用css3 transform属性刻画钟表的的刻度以及指针的角度,代码如下: <head> <meta charset="UTF-8"> <titl ...

  7. 用CSS3实现钟表效果

    背景:最近在学习CSS3,看到了一个小案例,通过自己的学习,动手实现了它,现在把它分享出来. 效果图 实现过程 1.首先我们需要在页面中写出一个静态的钟表效果.首先我们需要一个表盘div wrap 对 ...

  8. 分别用canvas和css3的transform做出钟表的效果

    两种方式实际上在js上的原理都是一样的.都是获取时间对象,再获取时间对象的时分秒,时分秒乘以其旋转一刻度(一秒.一分.一小时)对应的角度.css3中要赋值于transform:rotate(角度),c ...

  9. 【学】CSS3的3D动画 ——3D旋转之骰子样式的钟表(2)上

    这个是3D旋转的进阶版,是一个类似与骰子的正方体.这个版本只有秒数的个位数,还没有写整个钟表,下面那个版本好好想想该怎么写 这个效果需要用到transform-style: preserve-3d. ...

随机推荐

  1. 如何实现wpf的多国语言

    http://www.cnblogs.com/horan/archive/2012/04/20/wpf-multilanguage.html 4.0版本的locbaml http://michaels ...

  2. Getting Error "Invalid Argument to LOCATOR.CONTROL: ORG_LOCATOR_CONTROL='' in Material Requirements Form (文档 ID 1072379.1)

    APPLIES TO: Oracle Work in Process - Version 11.5.10.2 and later Information in this document applie ...

  3. 第十一篇 Material Status设置与测试,制药业案例一则

    详见,http://bbs.erp100.com/thread-273173-1-1.htmlMaterial Status不同于Item Status.Item Status用于统一控制Item的s ...

  4. emplace_back减少内存拷贝和移动

    --------<深入应用C++11:代码优化与工程级应用>第2章使用C++11改进程序性能,本章将分别介绍右值引用相关的新特性.本节为大家介绍emplace_back减少内存拷贝和移动. ...

  5. leetcode:Number of 1 Bits

    Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also know ...

  6. JUnit 4

    本文是转载的, 主要介绍 Junit 4 ( 搭建在 eclipse 中 ) JUnit4 初体验 Eclipse: 下载 Ant, 基于java的开源构建工具, 你可以在 http://ant.ap ...

  7. minimum-genetic-mutation

    题目还是很好的,提供了一种新的思路方向. 细节方面,开始我的判断条件用的dict,不太好,后来debug好了. 另外,注意其中用数组初始化Set的方法:Set<String> dict = ...

  8. malloc/free和new/delete的异同

    一.基本概念 malloc/free: 1.函数原型及说明: void *malloc(long NumBytes):该函数分配了NumBytes个字节,并返回了指向这块内存的指针.如果分配失败,则返 ...

  9. Repeater上下排序按钮

    aspx代码 <table cellspacing="0" cellpadding="0" width="100%" align=&q ...

  10. php数组排序函数

    下边提到的几个数组函数的排序有一些共性: 1 数组被作为排序函数的参数,排序以后,数组本身就发生了改变,函数的返回值为bool类型.2 函数名中出现单a表示association,含义为,在按值排序的 ...