-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
35 lines (33 loc) · 958 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>前端图片压缩</title>
</head>
<body>
<input type="file" id="imgFile" multiple>
<div>
压缩前:
<img src="" id="original" alt="">
</div>
<div>
压缩后:
<img src="" id="modified" alt="">
</div>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script src="minify_img_upload.js"></script>
<script>
$(function () {
$("#imgFile").on("change", function(){
$.minifyImgUploade(this.files[0], function (imgData) {
$("#modified").attr("src", imgData)
// upload
// $.post("server.php", { imgData: imgData }, function (res) {
// console.log(1);
// }, 'json');
}, 0.2)
})
});
</script>
</body>
</html>