-
Notifications
You must be signed in to change notification settings - Fork 75
/
getImg.html
42 lines (39 loc) · 865 Bytes
/
getImg.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.result{
width: 300px;
height: 300px;
background: #eee;
}
.result4 .demo {
position: absolute;
top: 50%;
left: 50%;
margin-top: -765px;
margin-left: -765px;
width: 1529px;
height: 1529px;
background: url(/light.png) no-repeat;
background-size: 100% 100%;
}
</style>
</head>
<body>
<div class="result" id="result">
<div class="demo"></div>
</div>
<button onclick="fun()">点击加载图片</button>
<script>
function fun(){
console.log('chufa ')
result.className = 'result result4'
}
</script>
</body>
</html>