-
Notifications
You must be signed in to change notification settings - Fork 4
/
pictring.html
63 lines (56 loc) · 1.9 KB
/
pictring.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!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>
<link rel="stylesheet" href="./css/pictring.css">
<style>
.go{
margin: 20px auto;
display: block;
padding: 16px 30px;
border-radius: 6px;
border: 0;
background-color: #e86767;
font-size: 1rem;
color: #fff;
}
.upBox{
padding-top: 60px
}
</style>
</head>
<body>
<div class="upBox">
<div id="dom"></div>
</div>
<button href="#" class="go" onclick="go()">see files</button>
<script src='./pictring.js'></script>
<script>
var pictring;
window.onload = function(){
pictring = new PicTring({
up: document.getElementById("dom"), //dom
imgType:'img', //上传图片的类型 img / base,默认为base
type:'file', //上传图片方式
max:9 , //最大图片 默认为9
drag:false, //禁止图片拖拽排序 默认为false 即可拖拽排序
boxSize: 80 , //容器尺寸,屏幕的百分比,也可传入定值的px
compress:0.8 , //图片质量,0-1, 'no'为原图
maxSize: 600, //对超过多少kb的图片进行压缩,默认为500
});
}
function go(){
alert(
pictring.upfiles()//获取已上图片的值 可输入数字/数组 ,空值返回全部图片
) ;
console.log(
pictring.upfiles()
)
pictring.empty();
}
</script>
</body>
</html>