当前位置:网站首页>图片缩放中心
图片缩放中心
2022-07-06 10:19:00 【全栈程序员站长】
大家好,又见面了,我是全栈君。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>图片放大居中</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>
版权声明:本文博客原创文章。博客,未经同意,不得转载。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/117400.html原文链接:https://javaforall.cn
边栏推荐
- C语言高校实验室预约登记系统
- Fleet tutorial 13 basic introduction to listview's most commonly used scroll controls (tutorial includes source code)
- Kivy tutorial: support Chinese in Kivy to build cross platform applications (tutorial includes source code)
- 2019阿里集群数据集使用总结
- STM32按键状态机2——状态简化与增加长按功能
- Prophet模型的简介以及案例分析
- Selected technical experts from China Mobile, ant, SF, and Xingsheng will show you the guarantee of architecture stability
- F200 - UAV equipped with domestic open source flight control system based on Model Design
- Scratch epidemic isolation and nucleic acid detection Analog Electronics Society graphical programming scratch grade examination level 3 true questions and answers analysis June 2022
- Jerry's updated equipment resource document [chapter]
猜你喜欢
【Swoole系列2.1】先把Swoole跑起来
Jerry's updated equipment resource document [chapter]
Pytest learning ----- detailed explanation of the request for interface automation test
虚拟机VirtualBox和Vagrant安装
简单易用的PDF转SVG程序
Distill knowledge from the interaction model! China University of science and Technology & meituan proposed virt, which combines the efficiency of the two tower model and the performance of the intera
Implementation of queue
TOP命令详解
SAP Fiori 应用索引大全工具和 SAP Fiori Tools 的使用介绍
Declval of template in generic programming
随机推荐
FMT open source self driving instrument | FMT middleware: a high real-time distributed log module Mlog
Declval of template in generic programming
传输层 拥塞控制-慢开始和拥塞避免 快重传 快恢复
面向程序员的精品开源字体
adb常用命令
C语言高校实验室预约登记系统
李書福為何要親自掛帥造手機?
Why should Li Shufu personally take charge of building mobile phones?
F200——搭载基于模型设计的国产开源飞控系统无人机
Dichotomy (integer dichotomy, real dichotomy)
Getting started with pytest ----- test case rules
TCP packet sticking problem
win10系统下插入U盘有声音提示却不显示盘符
Today in history: the mother of Google was born; Two Turing Award pioneers born on the same day
2022暑期项目实训(二)
【Android】Kotlin代码编写规范化文档
Brief description of SQL optimization problems
Insert dial file of Jerry's watch [chapter]
Open source and safe "song of ice and fire"
OpenEuler 会长久吗