forked from Lzccug/ImageCompression
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
48 lines (47 loc) · 1005 Bytes
/
index.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
43
44
45
46
47
48
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="js/exif.min.js"></script>
<script src="js/processImg.js"></script>
<style>
.imageFrame{
width: 240px;
position: relative;
margin: 10px auto;
border: 6px solid #c8c8c8;
background:rgba(0,0,0,0.3);
}
.imageFrame input{
position: absolute;
top: 0;
left: 0;
border: 0;
background: none;
width: 100%;
height:100%;
}
.imageFrame input[type="file"]{
opacity:0;
}
.imageFrame img{
width: 100%;
display: block;
}
</style>
</head>
<body>
<div class="imageFrame">
<input name="upimage" id="upimage" type="file">
<input type="button" id="upimageButton" onclick="upimage.click()">
<img id="showimage" src="images/dengni37.jpg" alt="">
</div>
<div style="display:block;">
</div>
<script>
compressImg('upimage','showimage',480,function(src){
console.log(src);
});
</script>
</body>
</html>