jq实现瀑布流效果
<!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实现瀑布流效果的更多相关文章
- RecylerView完美实现瀑布流效果
RecylerView包含三种布局管理器,分别是LinearLayoutManager,GridLayoutManager,StaggeredGridLayoutManager,对应实现单行列表,多行 ...
- 使用JS实现图片展示瀑布流效果
不知大家有没有发现,一般的图片展示网站都会使用瀑布流效果,所谓的瀑布流 就是网站内的图片不会一下子全缓存出来,而是等你滚动到一定的距离的时候, 下面的图片才会继续缓存,并且图片也是随机出现的,只是宽度 ...
- WPF下制作的简单瀑布流效果
最近又在搞点小东西,美化界面的时候发现瀑布流效果比较不错.顺便就搬到了WPF,下面是界面 我对WEB前端不熟,JS和CSS怎么实现的,我没去研究过,这里就说下WPF的实现思路,相当简单. 1.最重要的 ...
- [Android Pro] RecyclerView实现瀑布流效果(二)
referece to : http://blog.csdn.net/u010687392 在上篇中我们知道RecyclerView中默认给我们提供了三种布局管理器,分别是LinearLayoutMa ...
- RecyclerView实现瀑布流效果(图文详解+源码奉送)
最近有时间研究了一下RecyclerView,果然功能强大啊,能实现的效果还是比较多的,那么今天给大家介绍一个用RecyclerView实现的瀑布流效果. 先来一张效果图: 看看怎么实现吧: 整体工程 ...
- 用jQuery实现瀑布流效果学习笔记
jQuery一直没系统的学,只知道是js库,封装了好多js函数,方便了开发.以前做过一个原生的图片网站瀑布流效果,超级麻烦,这次用了jQuery方法,瞬间代码浓缩了,只有56行js代码.神奇的让我来把 ...
- css浮动+应用(瀑布流效果的实现)
首先是index.html文件: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"& ...
- 手把手教你js原生瀑布流效果实现
手把手教你js原生瀑布流效果实现 什么是瀑布流效果 首先,让我们先看一段动画: 在动画中,我们不难发现,这个动画有以下特点: 1.所有的图片的宽度都是一样的 2.所有的图片的高度是不一样的 3.图片一 ...
- 利用JS实现简单的瀑布流效果
哈哈, 我又来啦, 在这一段时间里, 我简单的学习了一下javascript(JS), 虽然不是很懂啦, 但是我也简单的尝试着做了点小东西, 就比如现在流行的瀑布流效果, 经过我的努力终于成功的完成了 ...
随机推荐
- 转 python 之 分割参数getopt
python 之 分割参数getopt os下有个方法walk,非常的好用,用来生成一个generator.每次可以得到一个三元tupple,其中第一个为起始路径,第二个为起始路径下的文件夹,第三个是 ...
- [TypeScript ] What Happens to Compiled Interfaces
This lesson covers using your first TypeScript Interface and what happens to the Interface when it i ...
- Obj2002java
计算球体积 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submi ...
- 照片浏览器软件-WTL开发的照片浏览器
前段时间,为了准备情人节礼物,本人想了做一个照片浏览器送给女友,专门播放我俩的所有照片的一个程序软件,于是,就写了这么一个照片浏览器软件.本程序是基于WTL8.0开发的一个图片/照片浏览器,涉及到XM ...
- datatables定义列宽自适应方法
不同的分辨率以及浏览器自适应,列表不出现滚动条,表格内容自动换行. 方法:通过定义表格列属性,结合<table>CSS样式和定义的列单元格样式 'td_huanhang'/'td_unhu ...
- (转)C#中的泛型
来源:http://www.cnblogs.com/JimmyZhang/archive/2008/12/17/1356727.html .Net 1.1版本最受诟病的一个缺陷就是没有提供对泛型的支持 ...
- 前台 添加引用 iis文件路径
1. <script src="../../../_layouts/15/JS/jquery-1.7.2.js"></script> 在前台添加的引用与II ...
- A题笔记(1)
#include <stdlib.h> exit(); #include <stdlib.h> 是 exit(0) 必须的头文件 否则会出现 exit was not decl ...
- 额定能量不得超过160Wh, 等同是多少mAh电池容量?
额定能量不得超过160Wh, 等同是多少mAh电池容量?行动电源容量标示, 正确应该是用Whr(Wh)瓦特小时来标示, 不过坊间标榜行动电源的容量通常是用xx000mAhWHr瓦特小时, 即是行动电源 ...
- MyBatis的学习总结四:实现关联表查询【参考】
一.一对一的表关联查询(edi_test_task 和 edi_task_detail) 例子:一条任务明细对一条任务记录 对应的sql的映射xml文件如下: <?xml version=& ...