代码拉取完成,页面将自动刷新
同步操作将从 zhao/相册 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body {
background-image: url('http://stdl.qq.com/stdl/skin/upload/production/305bb8fd2d58069e4a85016132ec66c1.webp');
}
.tu1 {
width: 250px;
height: 250px;
position: absolute;
top: 0;
left: 0;
background-image: url(http://m.imeitou.com/uploads/allimg/2018111811/be22pkn1zpo.jpg);
z-index: 10;
}
.tu2 {
width: 550px;
height: 350px;
position: absolute;
top: 100px;
left: 100px;
background-image: url(http://m.imeitou.com/uploads/allimg/2018111811/a2lxdhdm2oc.jpg);
z-index: 10;
}
.tu3 {
position: absolute;
top: 300px;
left: 300px;
width: 450px;
height: 200px;
background-image: url(http://m.imeitou.com/uploads/allimg/2018111811/nnvaplm2vw1.jpg);
}
.tu4 {
width: 550px;
height: 250px;
background-image: url(http://m.imeitou.com/uploads/allimg/2018111811/xpz5go532wr.jpg);
position: absolute;
top: 500px;
left: 500px;
}
.borders {
border: 5px solid #fff;
}
</style>
</head>
<body>
<div class="tu1 borders"></div>
<div class="tu2 borders"></div>
<div class="tu3 borders"></div>
<div class="tu4 borders"></div>
<script>
// 随意挪动图片
var img1 = document.querySelector('.tu1');
var img2 = document.querySelector('.tu2');
var img3 = document.querySelector('.tu3');
var img4 = document.querySelector('.tu4');
//通过给背景图片设置鼠标事件实现
img1.addEventListener('mousedown', function(e) {
var x = e.pageX - this.offsetLeft;
var y = e.pageY - this.offsetTop;
document.addEventListener('mousemove', ha)
img2.style.zIndex = '1';
function ha(e) {
img1.style.left = e.pageX - x + 'px';
img1.style.top = e.pageY - y + 'px';
img1.style.zIndex = '999';
}
document.addEventListener('mouseup', function() {
document.removeEventListener('mousemove', ha);
img1.style.zIndex = '11';
})
})
img2.addEventListener('mousedown', function(e) {
var x = e.pageX - this.offsetLeft;
var y = e.pageY - this.offsetTop;
document.addEventListener('mousemove', haa)
img2.style.zIndex = '1';
function haa(e) {
img2.style.left = e.pageX - x + 'px';
img2.style.top = e.pageY - y + 'px';
img2.style.zIndex = '999';
}
document.addEventListener('mouseup', function() {
document.removeEventListener('mousemove', haa);
img2.style.zIndex = '11';
})
})
img3.addEventListener('mousedown', function(e) {
var x = e.pageX - this.offsetLeft;
var y = e.pageY - this.offsetTop;
document.addEventListener('mousemove', hahaa)
img3.style.zIndex = '1';
function hahaa(e) {
img3.style.left = e.pageX - x + 'px';
img3.style.top = e.pageY - y + 'px';
img3.style.zIndex = '999';
}
document.addEventListener('mouseup', function() {
document.removeEventListener('mousemove', hahaa);
img3.style.zIndex = '11';
})
})
img4.addEventListener('mousedown', function(e) {
var x = e.pageX - this.offsetLeft;
var y = e.pageY - this.offsetTop;
document.addEventListener('mousemove', haha)
img4.style.zIndex = '1';
function haha(e) {
img4.style.left = e.pageX - x + 'px';
img4.style.top = e.pageY - y + 'px';
img4.style.zIndex = '999';
}
document.addEventListener('mouseup', function() {
document.removeEventListener('mousemove', haha);
img4.style.zIndex = '11';
})
})
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。