当前位置:网站首页>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
边栏推荐
- HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
- F200 - UAV equipped with domestic open source flight control system based on Model Design
- STM32+HC05串口蓝牙设计简易的蓝牙音箱
- 【剑指 Offer】 60. n个骰子的点数
- epoll()无论涉及wait队列分析
- 最新财报发布+天猫618双榜第一,耐克蓄力领跑下个50年
- UFIDA OA vulnerability learning - ncfindweb directory traversal vulnerability
- Splay
- Jielizhi obtains the customized background information corresponding to the specified dial [chapter]
- Cobra 快速入门 - 专为命令行程序而生
猜你喜欢
Jerry's access to additional information on the dial [article]
STM32按键状态机2——状态简化与增加长按功能
Four processes of program operation
I want to say more about this communication failure
Ms-tct: INRIA & SBU proposed a multi-scale time transformer for motion detection. The effect is SOTA! Open source! (CVPR2022)...
Windows连接Linux上安装的Redis
Top command details
【.NET CORE】 请求长度过长报错解决方案
[the 300th weekly match of leetcode]
從交互模型中蒸餾知識!中科大&美團提出VIRT,兼具雙塔模型的效率和交互模型的性能,在文本匹配上實現性能和效率的平衡!...
随机推荐
D binding function
celery最佳实践
Windows connects redis installed on Linux
转载:基于深度学习的工业品组件缺陷检测技术
具体说明 Flume介绍、安装和配置
TCP packet sticking problem
【剑指 Offer】 60. n个骰子的点数
Declval (example of return value of guidance function)
[the 300th weekly match of leetcode]
2019 Alibaba cluster dataset Usage Summary
简单易用的PDF转SVG程序
Comparative examples of C language pointers *p++, * (p++), * ++p, * (++p), (*p) + +, +(*p)
Jielizhi obtains the currently used dial information [chapter]
Dichotomy (integer dichotomy, real dichotomy)
Jerry is the custom background specified by the currently used dial enable [chapter]
Common - magic number 7
Shangsilicon Valley JUC high concurrency programming learning notes (3) multi thread lock
F200 - UAV equipped with domestic open source flight control system based on Model Design
Compilation principle - top-down analysis and recursive descent analysis construction (notes)
MSF横向之MSF端口转发+路由表+SOCKS5+proxychains