当前位置:网站首页>Picture zoom Center
Picture zoom Center
2022-07-06 18:25:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm the king of the whole stack .
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title> Picture zoomed in and centered </title>
<meta name="description" content="">
<meta name="keywords" content="">
<style>
*{margin:0; padding:0;}
ul,li{margin-right: 0; padding:0;}
li{list-style:none;}
a{text-decoration: none;}
.clearfix:before,.clearfix:after{display: table; content: "";}
.clearfix:after{overflow: hidden; clear: both;}
.clearfix{zoom:1;}
body{width: 100%; height: 100%; background-color: #000; overflow:hidden;}
#box{width:330px; margin:100px auto; position: relative;}
#box li{width:100px; height:100px; background:red; margin:10px 10px 0 0; float:left; color:#fff; line-height:24px;}
</style>
</head>
<body>
<ul id="box" class="clearfix">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
<script src="js/app/move.js"></script>
<script>
window.onload = function(){
var aLi = document.getElementById('box').getElementsByTagName('li');
var arr = [];
var i=0;
var zIndex = 1;
for(i=0; i<aLi.length; i++){
aLi[i].innerHTML = 'left:'+aLi[i].offsetLeft + 'px' + '<br>top:'+ aLi[i].offsetTop + 'px';
arr.push({left:aLi[i].offsetLeft,top:aLi[i].offsetTop});
}
for(i=0; i<aLi.length; i++){
aLi[i].index = i;
aLi[i].style.left = arr[i].left + 'px';
aLi[i].style.top = arr[i].top + 'px';
aLi[i].style.position ='absolute';
aLi[i].style.margin = 0;
aLi[i].onmouseover = function(){
this.style.background = 'green';
this.style.zIndex=zIndex++;
startMove(this,{
width:200,
height:200,
left:arr[this.index].left - 50,
top:arr[this.index].top - 50
});
}
aLi[i].onmouseout = function(){
this.style.background = 'red';
startMove(this,{
width:100,
height:100,
left:arr[this.index].left,
top:arr[this.index].top
});
}
}
}
</script>
</body>
</html>Copyright notice : This article is an original blog article . Blog , Without consent , Shall not be reproduced .
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/117400.html Link to the original text :https://javaforall.cn
边栏推荐
- 44所高校入选!分布式智能计算项目名单公示
- Transport layer congestion control - slow start and congestion avoidance, fast retransmission, fast recovery
- HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
- 推荐好用的后台管理脚手架,人人开源
- Blue Bridge Cup real question: one question with clear code, master three codes
- Distiller les connaissances du modèle interactif! L'Université de technologie de Chine & meituan propose Virt, qui a à la fois l'efficacité du modèle à deux tours et la performance du modèle interacti
- Grafana 9.0 正式发布!堪称最强!
- 小程序在产业互联网中的作用
- The difference between parallelism and concurrency
- Splay
猜你喜欢

30 minutes to understand PCA principal component analysis

1700C - Helping the Nature

F200 - UAV equipped with domestic open source flight control system based on Model Design

模板于泛型编程之declval

第三季百度网盘AI大赛盛夏来袭,寻找热爱AI的你!

Recursive way

Declval (example of return value of guidance function)

78 year old professor Huake has been chasing dreams for 40 years, and the domestic database reaches dreams to sprint for IPO

CSRF vulnerability analysis

Why does wechat use SQLite to save chat records?
随机推荐
Jerry's updated equipment resource document [chapter]
Interesting - questions about undefined
FMT open source self driving instrument | FMT middleware: a high real-time distributed log module Mlog
解读云原生技术
echart简单组件封装
Rb157-asemi rectifier bridge RB157
STM32+ESP8266+MQTT协议连接OneNet物联网平台
TCP packet sticking problem
Heavy! Ant open source trusted privacy computing framework "argot", flexible assembly of mainstream technologies, developer friendly layered design
2019 Alibaba cluster dataset Usage Summary
UDP协议:因性善而简单,难免碰到“城会玩”
Jielizhi obtains the customized background information corresponding to the specified dial [chapter]
[sword finger offer] 60 Points of N dice
C语言自动预订飞机票问题
287. 寻找重复数
F200 - UAV equipped with domestic open source flight control system based on Model Design
使用cpolar建立一个商业网站(1)
微信为什么使用 SQLite 保存聊天记录?
STM32+MFRC522完成IC卡号读取、密码修改、数据读写
Dichotomy (integer dichotomy, real dichotomy)