jq實現瀑布流效果

來源:互聯網
上載者:User

標籤:

<!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實現瀑布流效果

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.