时钟+指针移到图片内部放大
来源:互联网 发布:linux安装gem命令 编辑:程序博客网 时间:2024/04/28 10:45
<style type="text/css" id="sty">
*{
margin: 0;
padding: 0;
list-style: none;
}
#box{
width: 200px;
height: 200px;
border: 1px solid #000;
border-radius: 50%;
margin: 20px auto;
position: relative;
}
#box ul{
width: 200px;
height: 200px;
position: relative;
}
#box ul li{
width: 2px;
height: 6px;
background: #000;
position: absolute;
left: 99px;
top: 0;
-webkit-transform-origin: center 100px;
}
/*#box ul li:nth-child(2){
-webkit-transform: rotate(6deg);
}
#box ul li:nth-child(3){
-webkit-transform: rotate(12deg);
}*/
#hours{
width: 6px;
height: 45px;
background: #000;
position: absolute;
left: 97px;
top: 55px;
-webkit-transform-origin: bottom;
-webkit-transform: rotate(50deg);
}
#min{
width: 4px;
height: 65px;
background: #0000CC;
position: absolute;
left: 98px;
top: 35px;
-webkit-transform-origin: bottom;
-webkit-transform: rotate(80deg);
}
#sec{
width: 2px;
height: 85px;
background: red;
position: absolute;
left: 99px;
top: 15px;
-webkit-transform-origin: bottom;
-webkit-transform: rotate(180deg);
}
#cro{
width: 20px;
height: 20px;
border-radius: 50%;
background: #000;
position: absolute;
left: 90px;
top: 90px;
}
</style>
<script type="text/javascript">
window.onload=function(){
var oBox=document.getElementById('box');
var oUl=oBox.getElementsByTagName('ul')[0];
var aLi=oBox.getElementsByTagName('li');
var oSty=document.getElementById('sty');
var html='';
for(var i=0;i<60;i++){
var oLi=document.createElement('li');
oUl.appendChild(oLi);
html+='#box ul li:nth-child('+(i+1)+'){-webkit-transform: rotate('+i*6+'deg);}';
}
oSty.innerHTML+=html;
//时分秒针的运动
var oHours=document.getElementById('hours');
var oMin=document.getElementById('min');
var oSec=document.getElementById('sec');
date();
setInterval(date,1000);
function date(){
var mydate=new Date();//获取系统时间
//时分秒之间的关系
var iSec=mydate.getSeconds();
var iMin=mydate.getMinutes()+iSec/60;
var iHours=mydate.getHours()+iMin/60;
//设置时分秒针的旋转角度
oSec.style.webkitTransform='rotate('+iSec*6+'deg)';
oMin.style.webkitTransform='rotate('+iMin*6+'deg)';
oHours.style.webkitTransform='rotate('+iHours*30+'deg)';
}
}
</script>
<style>
body{
background: pink;
}
.pic1{
width: 850px;
height: 600px;
margin: 0 auto;
/*margin-top: 150px;*/
}
.pic{
float: left;
width: 275px;
height: 200px;
margin-right: 2px;
margin-bottom: 2px;
border: 1px solid red;
overflow: hidden;
}
img{
width: 275px;
height: 200px;
}
img:hover{
transform:scale(1.5,1.5);
}
</style>
</head>
<body>
<div id="box">
<ul>
<!--<li></li>
<li></li>
<li></li>
<li></li>-->
</ul>
<div id="hours"></div>
<div id="min"></div>
<div id="sec"></div>
<div id="cro"></div>
</div>
<div class="pic1">
<div class="pic"><img src="img/timg.jpg" alt="" /></div>
<div class="pic"><img src="img/timg.jpg" alt="" /></div>
<div class="pic"><img src="img/timg.jpg" alt="" /></div>
<div class="pic"><img src="img/timg.jpg" alt="" /></div>
<div class="pic"><img src="img/timg.jpg" alt="" /></div>
<div class="pic"><img src="img/timg.jpg" alt="" /></div>
</div>
</body>
*{
margin: 0;
padding: 0;
list-style: none;
}
#box{
width: 200px;
height: 200px;
border: 1px solid #000;
border-radius: 50%;
margin: 20px auto;
position: relative;
}
#box ul{
width: 200px;
height: 200px;
position: relative;
}
#box ul li{
width: 2px;
height: 6px;
background: #000;
position: absolute;
left: 99px;
top: 0;
-webkit-transform-origin: center 100px;
}
/*#box ul li:nth-child(2){
-webkit-transform: rotate(6deg);
}
#box ul li:nth-child(3){
-webkit-transform: rotate(12deg);
}*/
#hours{
width: 6px;
height: 45px;
background: #000;
position: absolute;
left: 97px;
top: 55px;
-webkit-transform-origin: bottom;
-webkit-transform: rotate(50deg);
}
#min{
width: 4px;
height: 65px;
background: #0000CC;
position: absolute;
left: 98px;
top: 35px;
-webkit-transform-origin: bottom;
-webkit-transform: rotate(80deg);
}
#sec{
width: 2px;
height: 85px;
background: red;
position: absolute;
left: 99px;
top: 15px;
-webkit-transform-origin: bottom;
-webkit-transform: rotate(180deg);
}
#cro{
width: 20px;
height: 20px;
border-radius: 50%;
background: #000;
position: absolute;
left: 90px;
top: 90px;
}
</style>
<script type="text/javascript">
window.onload=function(){
var oBox=document.getElementById('box');
var oUl=oBox.getElementsByTagName('ul')[0];
var aLi=oBox.getElementsByTagName('li');
var oSty=document.getElementById('sty');
var html='';
for(var i=0;i<60;i++){
var oLi=document.createElement('li');
oUl.appendChild(oLi);
html+='#box ul li:nth-child('+(i+1)+'){-webkit-transform: rotate('+i*6+'deg);}';
}
oSty.innerHTML+=html;
//时分秒针的运动
var oHours=document.getElementById('hours');
var oMin=document.getElementById('min');
var oSec=document.getElementById('sec');
date();
setInterval(date,1000);
function date(){
var mydate=new Date();//获取系统时间
//时分秒之间的关系
var iSec=mydate.getSeconds();
var iMin=mydate.getMinutes()+iSec/60;
var iHours=mydate.getHours()+iMin/60;
//设置时分秒针的旋转角度
oSec.style.webkitTransform='rotate('+iSec*6+'deg)';
oMin.style.webkitTransform='rotate('+iMin*6+'deg)';
oHours.style.webkitTransform='rotate('+iHours*30+'deg)';
}
}
</script>
<style>
body{
background: pink;
}
.pic1{
width: 850px;
height: 600px;
margin: 0 auto;
/*margin-top: 150px;*/
}
.pic{
float: left;
width: 275px;
height: 200px;
margin-right: 2px;
margin-bottom: 2px;
border: 1px solid red;
overflow: hidden;
}
img{
width: 275px;
height: 200px;
}
img:hover{
transform:scale(1.5,1.5);
}
</style>
</head>
<body>
<div id="box">
<ul>
<!--<li></li>
<li></li>
<li></li>
<li></li>-->
</ul>
<div id="hours"></div>
<div id="min"></div>
<div id="sec"></div>
<div id="cro"></div>
</div>
<div class="pic1">
<div class="pic"><img src="img/timg.jpg" alt="" /></div>
<div class="pic"><img src="img/timg.jpg" alt="" /></div>
<div class="pic"><img src="img/timg.jpg" alt="" /></div>
<div class="pic"><img src="img/timg.jpg" alt="" /></div>
<div class="pic"><img src="img/timg.jpg" alt="" /></div>
<div class="pic"><img src="img/timg.jpg" alt="" /></div>
</div>
</body>
阅读全文
0 0
- 时钟+指针移到图片内部放大
- 鼠标移到图片放大效果
- 鼠标移到图片放大效果
- css bootstrap鼠标移到图片 放大
- 滑鼠移到圖片上有放大的效果
- Axure RP 8 教程-指针函数之商品图片放大
- 放大图片
- 图片放大
- 图片放大
- 放大图片
- STM32L151内部RTC时钟
- js放大镜效果。类似于淘宝产品内页多图展示代码,鼠标移到图片上有放大效果,方便查看产品细节,此代码适合网店产品展示,
- 图片时钟
- 鼠标移到图片后改变图片透明度
- 时钟三:用内部中断实现时钟
- ThreadX 内部系统时钟服务
- 图片缩小放大脚本
- 图片放大缩小代码
- 商城项目实战30:服务层加入Redis缓存
- PL/SQL 循环
- [ES6语法1]let和const
- ArcGIS 测距 添加相邻点之间的距离
- Unity发布Web版进行自适应
- 时钟+指针移到图片内部放大
- C#中HashTable的用法
- ImageView自适应高度
- 深度学习之tensorflow的探索
- yii2 window composer 安装
- SAP Batch表MCH1和MCHA的差别?
- poj2387
- 方格取数or传纸条
- Thinkphp ajax实现评论回复