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), 虽然不是很懂啦, 但是我也简单的尝试着做了点小东西, 就比如现在流行的瀑布流效果, 经过我的努力终于成功的完成了 ...
随机推荐
- ibatis 开发中的经验 (一)ibatis 和hibernate 在开发中的理解
这个项目的底层是用ibatis框架完毕,这几天也是都在用这个框架写代码,也有了一些简单的理解,把项目拿过来后基本的配置都已经配置好了,比方一些事务.日志控制等,在开发中主要用到的是写SQL语句以及熟悉 ...
- HTML里面Textarea换行总结
近期碰到一个数据转来转去转到Textrea里面能否真正按行存放的问题,在这里总结一下: 问题描写叙述: 比方get数据到一个TextArea里面,如“AAA BBB”,想把这段文字在TextAre ...
- 用apache的httpclient发请求和接受数据
此处发请求的是用httpclient4,请自己下载所需要的jar包. 发post请求,并得到数据. String url = "http://localhost:8080/lee" ...
- [D3] 4. d3.max
how to use d3.max to normalize your dataset visually within the specific bounds of a variable domain ...
- UVA - 10239 The Book-shelver's Problem
Description Problem D The Book-shelver's Problem Input: standard input Output: standard output Time ...
- LabVIEW设计模式系列——case结构模拟事件结构
标准:1.所有按钮的机械动作必须都用释放时触发或者单击时触发,这是为了保证仅仅触发一次动作. 标准:1.使用简单的case结构模拟事件结构.
- 也许是关于C#的一些常见误区
写这点东西主要是看到知乎上有人在讨论相关的问题,但是有不少人都在说一些不严谨,甚至是完全错误 但是流传甚广的东西,甚至是一些大神都在说,以下根据我的回答总结. 一个很常见又很低级的误区是:认为引 ...
- hdu2074java
叠筐 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submissi ...
- 看懂下面C++代码才说你理解了C++多态虚函数!
#include <iostream> using namespace std ; class Father { private : virtual void Say() //只有添加 ...
- oracle常用数据类型
oracle中常用数据类型分为三大类: