<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>钟表</title>
<style type="text/css" id="css">
    #clock{width:200px;height:200px;border:2px solid #333333;margin:100px auto;border-radius:50%;position: relative;
            box-shadow: 0 0 10px #FCE300; background:url(1.jpg) no-repeat;background-size: 200px 200px;}
    #clock ul{margin: 0;padding: 0;list-style: none;height:200px;position: relative;}
    #clock ul li{background: #010101;width: 2px;height: 6px;position: absolute;left:99px;top:0;
                -webkit-transform-origin:center 100px;-moz-transform-origin:center 100px;
                -ms-transform-origin:center 100px;-o-transform-origin:center 100px;
                transform-origin:center 100px;}
    #clock ul li:nth-of-type(5n+1){height:10px;}    
    #hour{width: 6px;height: 35px;background: #f00;position: absolute;left: 97px;top:65px;
                -webkit-transform-origin:bottom;-moz-transform-origin:bottom;
                -ms-transform-origin:bottom;-o-transform-origin:bottom;
                transform-origin:bottom;}    
    #min{width: 4px;height: 55px;background: blue;position: absolute;left: 98px;top:45px;
                -webkit-transform-origin:bottom;-moz-transform-origin:bottom;
                -ms-transform-origin:bottom;-o-transform-origin:bottom;
                transform-origin:bottom;}
    #sec{width: 2px;height: 80px;background: orange;position: absolute;left: 99px;top:20px;
                -webkit-transform-origin:bottom;-moz-transform-origin:bottom;
                -ms-transform-origin:bottom;-o-transform-origin:bottom;
                transform-origin:bottom;}    
    .Icon{position: absolute;left: 95px;top:95px;width: 10px;height: 10px;background:#242424;border-radius: 50%;}

</style>
<script type="text/javascript">
    window.onload=function(){
        var oCss = document.getElementById("css");
        var oClock = document.getElementById("clock");
        var oHour = document.getElementById("hour");
        var oMin = document.getElementById("min");
        var oSec = document.getElementById("sec");
        var oUl = oClock.getElementsByTagName('ul')[0];
        var aLi = oUl.getElementsByTagName('li');
        var str = "";
        var sCss = "";
        for(var i=0;i<60;i++){
            //var oLi = document.createElement('li');
            //oUl.appendChild(oLi);
            str+="<li></li>";
            sCss+="#clock ul li:nth-of-type("+(i+1)+"){-webkit-transform:rotate("+6*i+"deg);-moz-transform:rotate("+6*i+"deg);-ms-transform:rotate("+6*i+"deg);-o-transform:rotate("+6*i+"deg);transform:rotate("+6*i+"deg);}";
        }
        oUl.innerHTML = str;
        oCss.innerHTML += sCss;
        setInterval(time,1000);
        time();
        function time(){
            var oDate = new Date();    
            var aSec = oDate.getSeconds();
            var aMin = oDate.getMinutes()+aSec/60;
            var aHour = oDate.getHours()+aMin/60;    
            
            oHour.style.WebkitTransform = "rotate("+aHour*30+"deg)";
            oMin.style.WebkitTransform = "rotate("+aMin*6+"deg)";
            oSec.style.WebkitTransform = "rotate("+aSec*6+"deg)";
            oHour.style.MozTransform = "rotate("+aHour*30+"deg)";
            oMin.style.MozTransform = "rotate("+aMin*6+"deg)";
            oSec.style.MozTransform = "rotate("+aSec*6+"deg)";
            oHour.style.MsTransform = "rotate("+aHour*30+"deg)";
            oMin.style.MsTransform = "rotate("+aMin*6+"deg)";
            oSec.style.MsTransform = "rotate("+aSec*6+"deg)";
            oHour.style.OTransform = "rotate("+aHour*30+"deg)";
            oMin.style.OTransform = "rotate("+aMin*6+"deg)";
            oSec.style.OTransform = "rotate("+aSec*6+"deg)";
            oHour.style.transform = "rotate("+aHour*30+"deg)";
            oMin.style.transform = "rotate("+aMin*6+"deg)";
            oSec.style.transform = "rotate("+aSec*6+"deg)";
        }
        
    }
</script>
</head>
<body>
    <div id="clock">
        <ul>
            
        </ul>

<div id="hour"></div>
        <div id="min"></div>
        <div id="sec"></div>

<div class="Icon"></div>

</div>
</body>
</html>

jq实现瀑布流效果的更多相关文章

  1. RecylerView完美实现瀑布流效果

    RecylerView包含三种布局管理器,分别是LinearLayoutManager,GridLayoutManager,StaggeredGridLayoutManager,对应实现单行列表,多行 ...

  2. 使用JS实现图片展示瀑布流效果

    不知大家有没有发现,一般的图片展示网站都会使用瀑布流效果,所谓的瀑布流 就是网站内的图片不会一下子全缓存出来,而是等你滚动到一定的距离的时候, 下面的图片才会继续缓存,并且图片也是随机出现的,只是宽度 ...

  3. WPF下制作的简单瀑布流效果

    最近又在搞点小东西,美化界面的时候发现瀑布流效果比较不错.顺便就搬到了WPF,下面是界面 我对WEB前端不熟,JS和CSS怎么实现的,我没去研究过,这里就说下WPF的实现思路,相当简单. 1.最重要的 ...

  4. [Android Pro] RecyclerView实现瀑布流效果(二)

    referece to : http://blog.csdn.net/u010687392 在上篇中我们知道RecyclerView中默认给我们提供了三种布局管理器,分别是LinearLayoutMa ...

  5. RecyclerView实现瀑布流效果(图文详解+源码奉送)

    最近有时间研究了一下RecyclerView,果然功能强大啊,能实现的效果还是比较多的,那么今天给大家介绍一个用RecyclerView实现的瀑布流效果. 先来一张效果图: 看看怎么实现吧: 整体工程 ...

  6. 用jQuery实现瀑布流效果学习笔记

    jQuery一直没系统的学,只知道是js库,封装了好多js函数,方便了开发.以前做过一个原生的图片网站瀑布流效果,超级麻烦,这次用了jQuery方法,瞬间代码浓缩了,只有56行js代码.神奇的让我来把 ...

  7. css浮动+应用(瀑布流效果的实现)

    首先是index.html文件: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"& ...

  8. 手把手教你js原生瀑布流效果实现

    手把手教你js原生瀑布流效果实现 什么是瀑布流效果 首先,让我们先看一段动画: 在动画中,我们不难发现,这个动画有以下特点: 1.所有的图片的宽度都是一样的 2.所有的图片的高度是不一样的 3.图片一 ...

  9. 利用JS实现简单的瀑布流效果

    哈哈, 我又来啦, 在这一段时间里, 我简单的学习了一下javascript(JS), 虽然不是很懂啦, 但是我也简单的尝试着做了点小东西, 就比如现在流行的瀑布流效果, 经过我的努力终于成功的完成了 ...

随机推荐

  1. 23讲 URL2

    这是关于URL路由的小笔记. 为什么用使用URL路由呢? 我的想法是:用户在地址栏可以乱传参数,所以我们必须最出一些防范措施,防止出现用户看到的不友好界面. 例如地址栏的地址为:http://loca ...

  2. Java-struts2的问题 java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils

    缺commons-lang3-3.1.jar,添加之后就可以了

  3. careercup-数组和字符串1.7

    1.7 编写一个算法,若M*N矩阵中某个元素为0,则将其所在的行与列清零. 类似于leetcode中的 Set Matrix Zeroes C++实现代码: #include<iostream& ...

  4. hdu 1199 Color the Ball(离散化线段树)

    Color the Ball Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) T ...

  5. Java基础知识强化之集合框架笔记61:Map集合之统计字符串中每个字符出现的次数的案例

    1. 首先我们看看统计字符串中每个字符出现的次数的案例图解: 2. 代码实现: (1)需求 :"aababcabcdabcde",获取字符串中每一个字母出现的次数要求结果:a(5) ...

  6. 通过扫描包路径获取包内class

    public static Set<Class<?>> getClasses(ClassLoader classLoader, String pack) { Set<Cl ...

  7. 正则表达式工具类,正则表达式封装,Java正则表达式

    正则表达式工具类 正则表达式封装 Java正则表达式 >>>>>>>>>>>>>>>>>>& ...

  8. 核心运营报表无线端数据,pv,uv相关数据,从9月1号开始就没了,为什么?

    问题现象截图 核心运营报表 从获取数据的api的地址可以看出: http://data.51buy.com/json.php?biz=statistic&mod=OrderKeyData&am ...

  9. [IO] C# INI文件读写类与源码下载 (转载)

    /// <summary> /// 类说明:INI文件读写类. /// 编 码 人:苏飞 /// 联系方式:361983679 /// 更新网站:[url]http://www.sufei ...

  10. Hadoop 系列 - (1) - 学习随笔 - 起源、构成

    起源:Hadoop是google 的集群系统的开源实现            --Google集群系统,:GFS(Google file system),MapReduce,BigTable(严格意义 ...